mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Fix code-style (using PHPCSFixer and PHPCS).
This commit is contained in:
@@ -16,6 +16,7 @@ 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;
|
||||
@@ -83,8 +84,10 @@ class EventChoiceLoader implements ChoiceLoaderInterface
|
||||
|
||||
$event = $this->eventRepository->find($value);
|
||||
|
||||
if ($this->hasCenterFilter()
|
||||
&& !in_array($event->getCenter(), $this->centers, true)) {
|
||||
if (
|
||||
$this->hasCenterFilter()
|
||||
&& !in_array($event->getCenter(), $this->centers, true)
|
||||
) {
|
||||
throw new RuntimeException('chosen an event not in correct center');
|
||||
}
|
||||
|
||||
|
@@ -29,6 +29,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
|
||||
@@ -170,10 +171,14 @@ class PickEventType extends AbstractType
|
||||
. 'option must be an instance of ' . Center::class);
|
||||
}
|
||||
|
||||
if (!in_array($c->getId(), array_map(
|
||||
static function (Center $c) { return $c->getId(); },
|
||||
$centers
|
||||
), true)) {
|
||||
if (
|
||||
!in_array($c->getId(), array_map(
|
||||
static function (Center $c) {
|
||||
return $c->getId();
|
||||
},
|
||||
$centers
|
||||
), true)
|
||||
) {
|
||||
throw new AccessDeniedException('The given center is not reachable');
|
||||
}
|
||||
$selectedCenters[] = $c;
|
||||
|
Reference in New Issue
Block a user