apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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;
}
}