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:
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\PostalCode;
|
||||
use Chill\MainBundle\Repository\PostalCodeRepository;
|
||||
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
|
||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||
|
||||
use function call_user_func;
|
||||
|
||||
/**
|
||||
|
@@ -17,6 +17,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use function array_combine;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
@@ -15,7 +15,6 @@ use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\PermissionsGroup;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
|
@@ -16,10 +16,10 @@ use Chill\MainBundle\Security\RoleProvider;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
|
@@ -18,6 +18,7 @@ use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
use Traversable;
|
||||
|
||||
use function count;
|
||||
|
||||
class CenterTransformer implements DataTransformerInterface
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
|
||||
use function array_diff;
|
||||
use function array_values;
|
||||
use function count;
|
||||
|
@@ -23,6 +23,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
|
||||
use function array_intersect;
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
@@ -85,7 +86,9 @@ class PickCenterType extends AbstractType
|
||||
'query_builder' => static function (EntityRepository $er) use ($centers) {
|
||||
$qb = $er->createQueryBuilder('c');
|
||||
$ids = array_map(
|
||||
static function (Center $el) { return $el->getId(); },
|
||||
static function (Center $el) {
|
||||
return $el->getId();
|
||||
},
|
||||
$centers
|
||||
);
|
||||
|
||||
@@ -93,7 +96,9 @@ class PickCenterType extends AbstractType
|
||||
},
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choice_label' => static function (Center $c) { return $c->getName(); },
|
||||
'choice_label' => static function (Center $c) {
|
||||
return $c->getName();
|
||||
},
|
||||
'data' => count($this->groupingCenters) > 0 ? null : $centers,
|
||||
]);
|
||||
|
||||
@@ -122,8 +127,12 @@ class PickCenterType extends AbstractType
|
||||
}
|
||||
|
||||
$builder->addModelTransformer(new CallbackTransformer(
|
||||
function ($data) use ($centers) { return $this->transform($data, $centers); },
|
||||
function ($data) use ($centers) { return $this->reverseTransform($data, $centers); }
|
||||
function ($data) use ($centers) {
|
||||
return $this->transform($data, $centers);
|
||||
},
|
||||
function ($data) use ($centers) {
|
||||
return $this->reverseTransform($data, $centers);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,6 @@ use Chill\MainBundle\Export\ExportManager;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
use function array_combine;
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
@@ -20,6 +20,7 @@ use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
use function uniqid;
|
||||
|
||||
/**
|
||||
|
@@ -25,6 +25,7 @@ use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function array_merge;
|
||||
use function array_values;
|
||||
use function count;
|
||||
@@ -151,8 +152,10 @@ class PickCenterType extends AbstractType
|
||||
$centers = [];
|
||||
|
||||
foreach ($scopes as $scope) {
|
||||
foreach ($this->authorizationHelper
|
||||
->getReachableCenters($this->security->getUser(), $role, $scope) as $center) {
|
||||
foreach (
|
||||
$this->authorizationHelper
|
||||
->getReachableCenters($this->security->getUser(), $role, $scope) as $center
|
||||
) {
|
||||
$centers[spl_object_hash($center)] = $center;
|
||||
}
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use const SORT_FLAG_CASE;
|
||||
use const SORT_STRING;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use const SORT_FLAG_CASE;
|
||||
use const SORT_STRING;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Translation\Translator;
|
||||
|
||||
use function in_array;
|
||||
|
||||
class TranslatableStringFormType extends AbstractType
|
||||
|
Reference in New Issue
Block a user