mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
cs: Fix code-style (using PHPCSFixer and PHPCS).
This commit is contained in:
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Repository\PersonRepository;
|
||||
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;
|
||||
@@ -76,8 +77,10 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
|
||||
|
||||
$person = $this->personRepository->find($value);
|
||||
|
||||
if ($this->hasCenterFilter()
|
||||
&& !in_array($person->getCenter(), $this->centers, true)) {
|
||||
if (
|
||||
$this->hasCenterFilter()
|
||||
&& !in_array($person->getCenter(), $this->centers, true)
|
||||
) {
|
||||
throw new RuntimeException('chosen a person not in correct center');
|
||||
}
|
||||
|
||||
|
@@ -16,6 +16,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Symfony\Component\Form\DataMapperInterface;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
|
||||
use function array_key_exists;
|
||||
use function is_array;
|
||||
|
||||
|
@@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Form\Type;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
|
@@ -28,6 +28,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
|
||||
@@ -161,10 +162,14 @@ class PickPersonType 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;
|
||||
|
@@ -19,6 +19,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use const SORT_FLAG_CASE;
|
||||
use const SORT_STRING;
|
||||
|
||||
|
Reference in New Issue
Block a user