mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 20:43:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -13,14 +13,9 @@ namespace Chill\EventBundle\Form\ChoiceLoader;
|
||||
|
||||
use Chill\EventBundle\Entity\Event;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
|
||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||
|
||||
use function call_user_func;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Class EventChoiceLoader.
|
||||
*/
|
||||
@@ -46,7 +41,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
*/
|
||||
public function __construct(
|
||||
EntityRepository $eventRepository,
|
||||
?array $centers = null
|
||||
array $centers = null
|
||||
) {
|
||||
$this->eventRepository = $eventRepository;
|
||||
|
||||
@@ -62,7 +57,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
{
|
||||
return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList(
|
||||
$this->lazyLoadedEvents,
|
||||
static fn (Event $p) => call_user_func($value, $p)
|
||||
static fn (Event $p) => \call_user_func($value, $p)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -84,9 +79,9 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
|
||||
if (
|
||||
$this->hasCenterFilter()
|
||||
&& !in_array($event->getCenter(), $this->centers, true)
|
||||
&& !\in_array($event->getCenter(), $this->centers, true)
|
||||
) {
|
||||
throw new RuntimeException('chosen an event not in correct center');
|
||||
throw new \RuntimeException('chosen an event not in correct center');
|
||||
}
|
||||
|
||||
$choices[] = $event;
|
||||
@@ -111,7 +106,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
$id = call_user_func($value, $choice);
|
||||
$id = \call_user_func($value, $choice);
|
||||
$values[] = $id;
|
||||
$this->lazyLoadedEvents[$id] = $choice;
|
||||
}
|
||||
@@ -124,6 +119,6 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
*/
|
||||
protected function hasCenterFilter()
|
||||
{
|
||||
return count($this->centers) > 0;
|
||||
return \count($this->centers) > 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user