diff --git a/.php_cs.dist.php b/.php_cs.dist.php index 772e26cec..c9cd4d06d 100644 --- a/.php_cs.dist.php +++ b/.php_cs.dist.php @@ -15,6 +15,7 @@ $config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php $config ->getFinder() ->ignoreDotFiles(false) + ->notPath('tests/app') ->name(['.php_cs.dist.php']); $rules = $config->getRules(); diff --git a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php index 9c78e54fd..7d8964903 100644 --- a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php +++ b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php @@ -29,8 +29,7 @@ namespace Chill\MainBundle\DependencyInjection; public function __construct( array $widgetFactories = [], ContainerBuilder $containerBuilder - ) - { + ) { // we register here widget factories (see below) $this->setWidgetFactories($widgetFactories); // we will need the container builder later... diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 5d9752408..0da266251 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -50,7 +50,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface foreach ($persons as $person) { $activityNbr = rand(0, 3); - for ($i = 0; $i < $activityNbr; ++$i ) { + for ($i = 0; $i < $activityNbr; ++$i) { $activity = $this->newRandomActivity($person); if (null !== $activity) { diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php index 6d46c4f14..dd23a9b8b 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php @@ -56,8 +56,8 @@ class Configuration implements ConfigurationInterface ->cannotBeEmpty() ->validate() ->ifTrue(function ($data) { - return !is_int($data); - })->thenInvalid('The value %s is not a valid integer') + return !is_int($data); + })->thenInvalid('The value %s is not a valid integer') ->end() ->end() ->scalarNode('label') diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 4df7fc2a4..5cba5ad57 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -125,24 +125,24 @@ class ActivityType extends AbstractType $builder->get('socialIssues') ->addModelTransformer(new CallbackTransformer( function (iterable $socialIssuesAsIterable): string { - $socialIssueIds = []; + $socialIssueIds = []; - foreach ($socialIssuesAsIterable as $value) { - $socialIssueIds[] = $value->getId(); - } + foreach ($socialIssuesAsIterable as $value) { + $socialIssueIds[] = $value->getId(); + } - return implode(',', $socialIssueIds); - }, + return implode(',', $socialIssueIds); + }, function (?string $socialIssuesAsString): array { - if (null === $socialIssuesAsString) { - return []; - } + if (null === $socialIssuesAsString) { + return []; + } - return array_map( - fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]), - explode(',', $socialIssuesAsString) - ); - } + return array_map( + fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]), + explode(',', $socialIssuesAsString) + ); + } )); } @@ -151,24 +151,24 @@ class ActivityType extends AbstractType $builder->get('socialActions') ->addModelTransformer(new CallbackTransformer( function (iterable $socialActionsAsIterable): string { - $socialActionIds = []; + $socialActionIds = []; - foreach ($socialActionsAsIterable as $value) { - $socialActionIds[] = $value->getId(); - } + foreach ($socialActionsAsIterable as $value) { + $socialActionIds[] = $value->getId(); + } - return implode(',', $socialActionIds); - }, + return implode(',', $socialActionIds); + }, function (?string $socialActionsAsString): array { - if (null === $socialActionsAsString) { - return []; - } + if (null === $socialActionsAsString) { + return []; + } - return array_map( - fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]), - explode(',', $socialActionsAsString) - ); - } + return array_map( + fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]), + explode(',', $socialActionsAsString) + ); + } )); } @@ -248,20 +248,20 @@ class ActivityType extends AbstractType $builder->get('persons') ->addModelTransformer(new CallbackTransformer( function (iterable $personsAsIterable): string { - $personIds = []; + $personIds = []; - foreach ($personsAsIterable as $value) { - $personIds[] = $value->getId(); - } + foreach ($personsAsIterable as $value) { + $personIds[] = $value->getId(); + } - return implode(',', $personIds); - }, + return implode(',', $personIds); + }, function (?string $personsAsString): array { - return array_map( - fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]), - explode(',', $personsAsString) - ); - } + return array_map( + fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]), + explode(',', $personsAsString) + ); + } )); } @@ -270,20 +270,20 @@ class ActivityType extends AbstractType $builder->get('thirdParties') ->addModelTransformer(new CallbackTransformer( function (iterable $thirdpartyAsIterable): string { - $thirdpartyIds = []; + $thirdpartyIds = []; - foreach ($thirdpartyAsIterable as $value) { - $thirdpartyIds[] = $value->getId(); - } + foreach ($thirdpartyAsIterable as $value) { + $thirdpartyIds[] = $value->getId(); + } - return implode(',', $thirdpartyIds); - }, + return implode(',', $thirdpartyIds); + }, function (?string $thirdpartyAsString): array { - return array_map( - fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]), - explode(',', $thirdpartyAsString) - ); - } + return array_map( + fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]), + explode(',', $thirdpartyAsString) + ); + } )); } @@ -303,20 +303,20 @@ class ActivityType extends AbstractType $builder->get('users') ->addModelTransformer(new CallbackTransformer( function (iterable $usersAsIterable): string { - $userIds = []; + $userIds = []; - foreach ($usersAsIterable as $value) { - $userIds[] = $value->getId(); - } + foreach ($usersAsIterable as $value) { + $userIds[] = $value->getId(); + } - return implode(',', $userIds); - }, + return implode(',', $userIds); + }, function (?string $usersAsString): array { - return array_map( - fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]), - explode(',', $usersAsString) - ); - } + return array_map( + fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]), + explode(',', $usersAsString) + ); + } )); } diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index 2f644aa94..d5ae9c528 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -30,8 +30,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface public function __construct( AuthorizationCheckerInterface $authorizationChecker, TranslatorInterface $translator - ) - { + ) { $this->translator = $translator; $this->authorizationChecker = $authorizationChecker; } diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php index eedbc0ecd..5c7ace286 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -71,8 +71,7 @@ class TranslatableActivityReasonTest extends TypeTestCase protected function getTranslatableStringHelper( $locale = 'en', $fallbackLocale = 'en' - ) - { + ) { $prophet = new \Prophecy\Prophet(); $requestStack = $prophet->prophesize(); $request = $prophet->prophesize(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php index 37e7bde0e..3c16197a8 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php @@ -26,11 +26,11 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; */ class ActivityVoterTest extends KernelTestCase { - use PrepareUserTrait; - use PrepareCenterTrait; - use PrepareScopeTrait; - use PreparePersonTrait; use PrepareActivityTrait; + use PrepareCenterTrait; + use PreparePersonTrait; + use PrepareScopeTrait; + use PrepareUserTrait; /** * @var \Prophecy\Prophet @@ -132,8 +132,7 @@ class ActivityVoterTest extends KernelTestCase Center $center, $attribute, $message - ) - { + ) { $token = $this->prepareToken($user); $activity = $this->prepareActivity($scope, $this->preparePerson($center)); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php index aee66db91..bcfc0b9a4 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php @@ -125,8 +125,8 @@ class Configuration implements ConfigurationInterface ->cannotBeEmpty() ->validate() ->ifTrue(function ($data) { - return !is_int($data); - })->thenInvalid('The value %s is not a valid integer') + return !is_int($data); + })->thenInvalid('The value %s is not a valid integer') ->end() ->end() ->scalarNode('label') diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php index c258d3ce7..1ed91894e 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php @@ -201,20 +201,20 @@ class CalendarType extends AbstractType $builder->get('invites') ->addModelTransformer(new CallbackTransformer( function (iterable $usersAsIterable): string { - $userIds = []; + $userIds = []; - foreach ($usersAsIterable as $value) { - $userIds[] = $value->getId(); - } + foreach ($usersAsIterable as $value) { + $userIds[] = $value->getId(); + } - return implode(',', $userIds); - }, + return implode(',', $userIds); + }, function (?string $usersAsString): array { - return array_map( - fn (string $id): ?Invite => $this->om->getRepository(Invite::class)->findOneBy(['id' => (int) $id]), - explode(',', $usersAsString) - ); - } + return array_map( + fn (string $id): ?Invite => $this->om->getRepository(Invite::class)->findOneBy(['id' => (int) $id]), + explode(',', $usersAsString) + ); + } )); } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php index f01aec0fd..856ac8ae9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -54,8 +54,7 @@ class CustomFieldChoice extends AbstractCustomField TranslatorInterface $translator, TwigEngine $templating, TranslatableStringHelper $translatableStringHelper - ) - { + ) { $this->defaultLocales = $translator->getFallbackLocales(); $this->templating = $templating; $this->translatableStringHelper = $translatableStringHelper; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php index 8f018ef58..8e2e9a80f 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php @@ -41,8 +41,7 @@ class CustomFieldText extends AbstractCustomField RequestStack $requestStack, TwigEngine $templating, TranslatableStringHelper $translatableStringHelper - ) - { + ) { $this->requestStack = $requestStack; $this->templating = $templating; $this->translatableStringHelper = $translatableStringHelper; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php index 0ab59eb16..1c59c7d2e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php @@ -41,8 +41,7 @@ class CustomFieldTitle extends AbstractCustomField RequestStack $requestStack, TwigEngine $templating, TranslatableStringHelper $translatableStringHelper - ) - { + ) { $this->requestStack = $requestStack; $this->templating = $templating; $this->translatableStringHelper = $translatableStringHelper; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php index 41751b71e..3efc2fa82 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php @@ -25,8 +25,7 @@ class CustomFieldDataTransformer implements DataTransformerInterface public function __construct( CustomFieldInterface $customFieldDefinition, CustomField $customField - ) - { + ) { $this->customFieldDefinition = $customFieldDefinition; $this->customField = $customField; } diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php index cd4cd215d..e32a35cee 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php @@ -39,8 +39,7 @@ class CustomFieldsHelper public function __construct( EntityManagerInterface $em, CustomFieldProvider $provider - ) - { + ) { $this->em = $em; $this->provider = $provider; } diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php index c1380fe5b..dd9d8e635 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php @@ -137,8 +137,7 @@ class DocGeneratorTemplateController extends AbstractController public function listTemplateApiAction( string $entityClassName, DocGeneratorTemplateRepository $templateRepository - ): Response - { + ): Response { $entities = $templateRepository->findByEntity($entityClassName); $ret = []; diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 041ed4fce..06307706b 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -120,7 +120,7 @@ class EventController extends AbstractController $this->addFlash( 'success', $this->get('translator') - ->trans('The event has been sucessfully removed') + ->trans('The event has been sucessfully removed') ); return $this->redirectToRoute('chill_main_search', [ diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 7ff49fa50..fc0abada1 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -275,7 +275,7 @@ class ParticipationController extends AbstractController $this->addFlash( 'success', $this->get('translator') - ->trans('The participation has been sucessfully removed') + ->trans('The participation has been sucessfully removed') ); return $this->redirectToRoute('chill_event__event_show', [ @@ -551,8 +551,7 @@ class ParticipationController extends AbstractController Request $request, Participation $participation, bool $multiple = false - ) - { + ) { $em = $this->getDoctrine()->getManager(); if ($em->contains($participation)) { @@ -653,8 +652,8 @@ class ParticipationController extends AbstractController $ignoredParticipations[] = $participation ->getEvent()->getParticipations()->filter( function (Participation $p) use ($participation) { - return $p->getPerson()->getId() === $participation->getPerson()->getId(); - } + return $p->getPerson()->getId() === $participation->getPerson()->getId(); + } )->first(); } else { $newParticipations[] = $participation; diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index a6e5b6e8f..bd0234740 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -45,8 +45,8 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa ->setCenter($center) ->setCircle( $this->getReference( - LoadScopes::$references[array_rand(LoadScopes::$references)] - ) + LoadScopes::$references[array_rand(LoadScopes::$references)] + ) ); $manager->persist($event); $events[] = $event; diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php index e615543c8..56da2cb40 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php @@ -70,20 +70,20 @@ class PickRoleType extends AbstractType $builder->addEventListener( FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { - if (null === $options['event_type']) { - $form = $event->getForm(); - $name = $form->getName(); - $config = $form->getConfig(); - $type = $config->getType()->getName(); - $options = $config->getOptions(); + if (null === $options['event_type']) { + $form = $event->getForm(); + $name = $form->getName(); + $config = $form->getConfig(); + $type = $config->getType()->getName(); + $options = $config->getOptions(); - $form->getParent()->add($name, $type, array_replace($options, [ - 'group_by' => function (Role $r) { - return $this->translatableStringHelper->localize($r->getType()->getName()); - }, - ])); - } - } + $form->getParent()->add($name, $type, array_replace($options, [ + 'group_by' => function (Role $r) { + return $this->translatableStringHelper->localize($r->getType()->getName()); + }, + ])); + } + } ); } } diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php index d09ca4d2f..f554943b2 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php @@ -74,17 +74,17 @@ class PickStatusType extends AbstractType $builder->addEventListener( FormEvents::PRE_SET_DATA, function (FormEvent $event) { - $form = $event->getForm(); - $name = $form->getName(); - $config = $form->getConfig(); - $type = $config->getType()->getName(); - $options = $config->getOptions(); - $form->getParent()->add($name, $type, array_replace($options, [ - 'group_by' => function (Status $s) { - return $this->translatableStringHelper->localize($s->getType()->getName()); - }, - ])); - } + $form = $event->getForm(); + $name = $form->getName(); + $config = $form->getConfig(); + $type = $config->getType()->getName(); + $options = $config->getOptions(); + $form->getParent()->add($name, $type, array_replace($options, [ + 'group_by' => function (Status $s) { + return $this->translatableStringHelper->localize($s->getType()->getName()); + }, + ])); + } ); } } diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 0921c8f96..3b16f346e 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -92,8 +92,7 @@ class EventSearch extends AbstractSearch $limit = 50, array $options = [], $format = 'html' - ) - { + ) { $total = $this->count($terms); $paginator = $this->paginationFactory->create($total); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php index 3f79b61ef..f03b5a5ba 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php @@ -235,9 +235,9 @@ class ParticipationControllerTest extends WebTestCase $this->personsIdsCache = array_merge( $this->personsIdsCache, $event->getParticipations()->map( - function ($p) { return $p->getPerson()->getId(); } - ) - ->toArray() + function ($p) { return $p->getPerson()->getId(); } + ) + ->toArray() ); // get some random people $person1 = $this->getRandomPerson(); @@ -476,8 +476,7 @@ class ParticipationControllerTest extends WebTestCase protected function getRandomEventWithMultipleParticipations( $centerName = 'Center A', $circleName = 'social' - ) - { + ) { $event = $this->getRandomEvent($centerName, $circleName); return $event->getParticipations()->count() > 1 ? diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 3fee45f44..fc6580f61 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -714,8 +714,7 @@ class CRUDController extends AbstractController int $totalItems, PaginatorInterface $paginator, ?FilterOrderHelper $filterOrder = null - ) - { + ) { $query = $this->queryEntities($action, $request, $paginator, $filterOrder); return $query->getQuery()->getResult(); diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index ff79862e2..eab491c52 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -206,6 +206,7 @@ class ExportController extends AbstractController * * @param string $alias * @param array $data the data from previous step. Required for steps 'formatter' and 'generate_formatter' + * @param mixed $step * * @return \Symfony\Component\Form\Form */ diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationController.php b/src/Bundle/ChillMainBundle/Controller/NotificationController.php index 7581126c3..58be0a33a 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationController.php @@ -35,8 +35,7 @@ class NotificationController extends AbstractController NotificationRepository $notificationRepository, NotificationRenderer $notificationRenderer, PaginatorFactory $paginatorFactory - ) - { + ) { $currentUser = $this->security->getUser(); $notificationsNbr = $notificationRepository->countAllForAttendee(($currentUser)); diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index a78c82d32..393849776 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -358,19 +358,19 @@ class PermissionsGroupController extends AbstractController usort( $roleScopes, function (RoleScope $a, RoleScope $b) use ($translatableStringHelper) { - if ($a->getScope() === null) { - return 1; - } + if ($a->getScope() === null) { + return 1; + } - if ($b->getScope() === null) { - return +1; - } + if ($b->getScope() === null) { + return +1; + } - return strcmp( - $translatableStringHelper->localize($a->getScope()->getName()), - $translatableStringHelper->localize($b->getScope()->getName()) - ); - } + return strcmp( + $translatableStringHelper->localize($a->getScope()->getName()), + $translatableStringHelper->localize($b->getScope()->getName()) + ); + } ); // sort role scope by title @@ -526,8 +526,7 @@ class PermissionsGroupController extends AbstractController private function createDeleteRoleScopeForm( PermissionsGroup $permissionsGroup, RoleScope $roleScope - ) - { + ) { return $this->createFormBuilder() ->setAction($this->generateUrl( 'admin_permissionsgroup_delete_role_scope', @@ -571,12 +570,12 @@ class PermissionsGroupController extends AbstractController $expandedRoles[$roleScope->getRole()] = array_map( function (Role $role) { - return $role->getRole(); - }, + return $role->getRole(); + }, $this->roleHierarchy - ->getReachableRoles( - [new Role($roleScope->getRole())] - ) + ->getReachableRoles( + [new Role($roleScope->getRole())] + ) ); } } diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php index b3ffd9b7c..04ac9332e 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeController.php @@ -51,15 +51,15 @@ class PostalCodeController extends AbstractController $query = $this->getDoctrine()->getManager() ->createQuery( sprintf( - 'SELECT p.id AS id, p.name AS name, p.code AS code, ' + 'SELECT p.id AS id, p.name AS name, p.code AS code, ' . 'country.name AS country_name, ' . 'country.countryCode AS country_code ' . 'FROM %s p ' . 'JOIN p.country country ' . 'WHERE LOWER(p.name) LIKE LOWER(:pattern) OR LOWER(p.code) LIKE LOWER(:pattern) ' . 'ORDER BY code', - PostalCode::class - ) + PostalCode::class + ) ) ->setParameter('pattern', '%' . $pattern . '%') ->setMaxResults(30); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index b2ccc1c3a..70c6fe1dc 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -78,8 +78,8 @@ class LoadUsers extends AbstractFixture implements OrderedFixtureInterface, Cont ->setUsername($username) ->setPassword( $encoderFactory - ->getEncoder($user) - ->encodePassword('password', $user->getSalt()) + ->getEncoder($user) + ->encodePassword('password', $user->getSalt()) ) ->setEmail(sprintf('%s@chill.social', str_replace(' ', '', $username))); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php index 11b8d5bca..b8b3b4d85 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php @@ -36,10 +36,10 @@ class ACLFlagsCompilerPass implements CompilerPassInterface default: throw new LogicException( sprintf( - "This tag 'scope' is not implemented: %s, on service with id %s", - $tag['scope'], - $id - ) + "This tag 'scope' is not implemented: %s, on service with id %s", + $tag['scope'], + $id + ) ); } } diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php index 82057010c..f91cfe126 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php @@ -47,8 +47,7 @@ class ExportsCompilerPass implements CompilerPassInterface private function compileAggregators( Definition $chillManagerDefinition, ContainerBuilder $container - ) - { + ) { $taggedServices = $container->findTaggedServiceIds( 'chill.export_aggregator' ); @@ -79,8 +78,7 @@ class ExportsCompilerPass implements CompilerPassInterface private function compileExportElementsProvider( Definition $chillManagerDefinition, ContainerBuilder $container - ) - { + ) { $taggedServices = $container->findTaggedServiceIds( 'chill.export_elements_provider' ); @@ -111,8 +109,7 @@ class ExportsCompilerPass implements CompilerPassInterface private function compileExports( Definition $chillManagerDefinition, ContainerBuilder $container - ) - { + ) { $taggedServices = $container->findTaggedServiceIds( 'chill.export' ); @@ -143,8 +140,7 @@ class ExportsCompilerPass implements CompilerPassInterface private function compileFilters( Definition $chillManagerDefinition, ContainerBuilder $container - ) - { + ) { $taggedServices = $container->findTaggedServiceIds( 'chill.export_filter' ); @@ -175,8 +171,7 @@ class ExportsCompilerPass implements CompilerPassInterface private function compileFormatters( Definition $chillManagerDefinition, ContainerBuilder $container - ) - { + ) { $taggedServices = $container->findTaggedServiceIds( 'chill.export_formatter' ); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php index 72f0cf224..85d0150ba 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php @@ -27,8 +27,7 @@ class Configuration implements ConfigurationInterface public function __construct( array $widgetFactories, ContainerBuilder $containerBuilder - ) - { + ) { $this->setWidgetFactories($widgetFactories); $this->containerBuilder = $containerBuilder; } diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php index 3a7d6262f..e6153bc4e 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php @@ -36,7 +36,7 @@ abstract class AbstractWidgetFactory implements WidgetFactoryInterface { return $containerBuilder->getDefinition( $this - ->getServiceId($containerBuilder, $place, $order, $config) + ->getServiceId($containerBuilder, $place, $order, $config) ); } } diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index 4b42f903a..150312f42 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -120,8 +120,8 @@ class PermissionsGroup { $roleScopesId = array_map( function (RoleScope $roleScope) { - return $roleScope->getId(); - }, + return $roleScope->getId(); + }, $this->getRoleScopes()->toArray() ); $countedIds = array_count_values($roleScopesId); diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index e0d09e94a..e80dd154c 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -92,8 +92,7 @@ class ExportManager AuthorizationCheckerInterface $authorizationChecker, AuthorizationHelper $authorizationHelper, TokenStorageInterface $tokenStorage - ) - { + ) { $this->logger = $logger; $this->em = $em; $this->authorizationChecker = $authorizationChecker; @@ -280,9 +279,9 @@ class ExportManager if (!is_iterable($result)) { throw new UnexpectedValueException( sprintf( - 'The result of the export should be an iterable, %s given', - gettype($result) - ) + 'The result of the export should be an iterable, %s given', + gettype($result) + ) ); } @@ -602,8 +601,7 @@ class ExportManager QueryBuilder $qb, $data, array $center - ) - { + ) { $aggregators = $this->retrieveUsedAggregators($data); foreach ($aggregators as $alias => $aggregator) { @@ -626,8 +624,7 @@ class ExportManager QueryBuilder $qb, $data, array $centers - ) - { + ) { $filters = $this->retrieveUsedFilters($data); foreach ($filters as $alias => $filter) { diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php index 16789f037..c1404d2b8 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php @@ -55,8 +55,7 @@ class CSVFormatter implements FormatterInterface public function __construct( TranslatorInterface $translator, ExportManager $manager - ) - { + ) { $this->translator = $translator; $this->exportManager = $manager; } diff --git a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php index 456767590..dc4ab0244 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php +++ b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php @@ -102,8 +102,7 @@ trait AppendScopeChoiceTypeTrait TranslatableStringHelper $translatableStringHelper, ObjectManager $om, $name = 'scope' - ) - { + ) { $reachableScopes = $authorizationHelper ->getReachableScopes($user, $role, $center); @@ -119,21 +118,21 @@ trait AppendScopeChoiceTypeTrait $builder->addEventListener( FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($choices, $name, $dataTransformer, $builder) { - $form = $event->getForm(); - $form->add( - $builder - ->create( - $name, - ChoiceType::class, - [ - 'choices' => array_combine(array_values($choices), array_keys($choices)), - 'auto_initialize' => false, - ] - ) - ->addModelTransformer($dataTransformer) - ->getForm() - ); - } + $form = $event->getForm(); + $form->add( + $builder + ->create( + $name, + ChoiceType::class, + [ + 'choices' => array_combine(array_values($choices), array_keys($choices)), + 'auto_initialize' => false, + ] + ) + ->addModelTransformer($dataTransformer) + ->getForm() + ); + } ); } } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 7ffc2520b..3bedc9a3d 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -58,8 +58,7 @@ class PickCenterType extends AbstractType TokenStorageInterface $tokenStorage, ExportManager $exportManager, AuthorizationHelper $authorizationHelper - ) - { + ) { $this->exportManager = $exportManager; $this->user = $tokenStorage->getToken()->getUser(); $this->authorizationHelper = $authorizationHelper; diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index d83690acb..cf062f1ab 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -105,14 +105,14 @@ class UserType extends AbstractType } else { $builder->add( $builder - ->create('enabled', ChoiceType::class, [ - 'choices' => [ - 'Disabled, the user is not allowed to login' => 0, - 'Enabled, the user is active' => 1, - ], - 'expanded' => false, - 'multiple' => false, - ]) + ->create('enabled', ChoiceType::class, [ + 'choices' => [ + 'Disabled, the user is not allowed to login' => 0, + 'Enabled, the user is active' => 1, + ], + 'expanded' => false, + 'multiple' => false, + ]) ); } } diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationRenderer.php b/src/Bundle/ChillMainBundle/Notification/NotificationRenderer.php index 43470fde9..1a8c68ca2 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationRenderer.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationRenderer.php @@ -21,8 +21,7 @@ final class NotificationRenderer public function __construct( AccompanyingPeriodNotificationRenderer $accompanyingPeriodNotificationRenderer, ActivityNotificationRenderer $activityNotificationRenderer - ) - { + ) { // TODO configure automatically // TODO CREER UNE INTERFACE POUR ETRE SUR QUE LES RENDERERS SONT OK diff --git a/src/Bundle/ChillMainBundle/Search/SearchProvider.php b/src/Bundle/ChillMainBundle/Search/SearchProvider.php index b3fb60958..ccf013f2a 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchProvider.php +++ b/src/Bundle/ChillMainBundle/Search/SearchProvider.php @@ -138,8 +138,7 @@ class SearchProvider $limit = 50, array $options = [], $format = 'html' - ) - { + ) { $terms = $this->parse($pattern); $search = $this->getByName($name); @@ -169,8 +168,7 @@ class SearchProvider $limit = 50, array $options = [], $format = 'html' - ) - { + ) { $terms = $this->parse($pattern); $results = []; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index 7a47ce57a..2e3a80219 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -35,6 +35,7 @@ class AddressRender implements ChillEntityRenderInterface /** * @param Address addr + * @param mixed $addr */ public function renderBox($addr, array $options): string { diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index d5221ce80..66ad3aa39 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -47,10 +47,10 @@ class FilterOrderHelper $this->checkboxes[$name] = [ 'choices' => $choices, 'default' => $default, 'trans' => array_merge( - $trans, - 0 < $missing ? + $trans, + 0 < $missing ? array_fill(0, $missing, null) : [] - ), + ), ]; return $this; diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php index 5a940b92d..2c12b89df 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php @@ -170,9 +170,9 @@ abstract class AbstractFilterTest extends KernelTestCase } $this->assertTrue( $catalogue->has( - $description[0], - $description[2] ?? 'messages' - ), + $description[0], + $description[2] ?? 'messages' + ), sprintf('Test that the message returned by getDescriptionAction is ' . 'present in the catalogue of translations. HINT : check that "%s" ' . 'is correctly translated', $description[0]) diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index b3cbb617a..3f4edc17d 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -230,11 +230,11 @@ class ExportManagerTest extends KernelTestCase Argument::is(['a' => 'b']) ) ->will(function () use ($em) { - $qb = $em->createQueryBuilder(); + $qb = $em->createQueryBuilder(); - return $qb->addSelect('COUNT(user.id) as export') - ->from('ChillMainBundle:User', 'user'); - }); + return $qb->addSelect('COUNT(user.id) as export') + ->from('ChillMainBundle:User', 'user'); + }); //$export->initiateQuery()->shouldBeCalled(); $export->supportsModifiers()->willReturn(['foo']); $export->requiredRole()->willReturn(new Role('CHILL_STAT_DUMMY')); @@ -254,7 +254,7 @@ class ExportManagerTest extends KernelTestCase Argument::Type('array') ) ->willReturn(function ($value) { - switch ($value) { + switch ($value) { case 0: case 1: return $value; @@ -264,7 +264,7 @@ class ExportManagerTest extends KernelTestCase default: throw new RuntimeException(sprintf('The value %s is not valid', $value)); } - }); + }); $export->getQueryKeys(Argument::Type('array'))->willReturn(['export']); $export->getTitle()->willReturn('dummy title'); @@ -294,7 +294,7 @@ class ExportManagerTest extends KernelTestCase Argument::is([]) ) ->willReturn(function ($value) { - switch ($value) { + switch ($value) { case '_header': return 'foo_header'; case 'cat a': return 'label cat a'; @@ -304,7 +304,7 @@ class ExportManagerTest extends KernelTestCase default: throw new RuntimeException(sprintf('This value (%s) is not valid', $value)); } - }); + }); $aggregator->addRole()->willReturn(null); //$aggregator->addRole()->shouldBeCalled(); $exportManager->addAggregator($aggregator->reveal(), 'aggregator_foo'); diff --git a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php index aa6ad67ac..9d35fc004 100644 --- a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php @@ -136,8 +136,7 @@ class PaginatorTest extends KernelTestCase $itemPerpage, $pageNumber, $expectedHasPage - ) - { + ) { $paginator = $this->generatePaginator($totalItems, $itemPerpage); $this->assertEquals($expectedHasPage, $paginator->hasPage($pageNumber)); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index 12b3a9c25..80a7af66a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -30,9 +30,9 @@ use function array_map; */ class AuthorizationHelperTest extends KernelTestCase { - use PrepareUserTrait; use PrepareCenterTrait; use PrepareScopeTrait; + use PrepareUserTrait; use ProphecyTrait; public function setUp() @@ -247,8 +247,7 @@ class AuthorizationHelperTest extends KernelTestCase Role $role, Center $center, $message - ) - { + ) { $reachableScopes = $this->getAuthorizationHelper() ->getReachableScopes($user, $role, $center); diff --git a/src/Bundle/ChillMainBundle/Tests/TestHelper.php b/src/Bundle/ChillMainBundle/Tests/TestHelper.php index 4320d20fd..4c009ae83 100644 --- a/src/Bundle/ChillMainBundle/Tests/TestHelper.php +++ b/src/Bundle/ChillMainBundle/Tests/TestHelper.php @@ -27,8 +27,7 @@ class TestHelper public static function getAuthenticatedClientOptions( $username = 'center a_social', $password = 'password' - ) - { + ) { return [ 'PHP_AUTH_USER' => $username, 'PHP_AUTH_PW' => $password, diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php index ec1d85e13..09c03f3ef 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php @@ -39,8 +39,7 @@ class RoleScopeScopePresence extends ConstraintValidator RoleProvider $roleProvider, LoggerInterface $logger, TranslatorInterface $translator - ) - { + ) { $this->roleProvider = $roleProvider; $this->logger = $logger; $this->translator = $translator; diff --git a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php index df9d0102d..e0ba03194 100644 --- a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php @@ -616,12 +616,12 @@ final class ImportPeopleFromCSVCommand extends Command $helper = $this->getHelper('question'); $question = new ChoiceQuestion( sprintf( - 'Which postal code match the ' + 'Which postal code match the ' . 'name "%s" with postal code "%s" ? (default to "%s")', - $locality, - $postalCode, - $names[0] - ), + $locality, + $postalCode, + $names[0] + ), $names, 0 ); @@ -908,11 +908,11 @@ final class ImportPeopleFromCSVCommand extends Command $this->output->writeln( sprintf( - 'You have selected "%s"', - is_array($answers[$matchingTableRowAnswer[$selected]]) ? + 'You have selected "%s"', + is_array($answers[$matchingTableRowAnswer[$selected]]) ? implode(',', $answers[$matchingTableRowAnswer[$selected]]) : $answers[$matchingTableRowAnswer[$selected]] - ) + ) ); // recording value in cache @@ -933,10 +933,10 @@ final class ImportPeopleFromCSVCommand extends Command $this->logger->debug( sprintf( - "Found value : %s for custom field with question '%s'", - is_array($value) ? implode(',', $value) : $value, - $this->helper->localize($cf->getName()) - ) + "Found value : %s for custom field with question '%s'", + is_array($value) ? implode(',', $value) : $value, + $this->helper->localize($cf->getName()) + ) ); return $value; diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index d72cc15b0..bb85036a9 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -64,9 +64,9 @@ class AccompanyingCourseWorkController extends AbstractController $this->addFlash( 'error', $this->trans->trans( - 'accompanying_work.You must add at least ' . + 'accompanying_work.You must add at least ' . 'one social issue on accompanying period' - ) + ) ); return $this->redirectToRoute('chill_person_accompanying_course_index', [ diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index eac7f0cd6..893dda03c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -296,7 +296,7 @@ class AccompanyingPeriodController extends AbstractController ->add( 'error', $this->get('translator') - ->trans('Period not opened : form is invalid') + ->trans('Period not opened : form is invalid') ); } } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php index 02e089904..e12c88332 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php @@ -30,7 +30,7 @@ class LoadHouseholdPosition extends Fixture public function load(ObjectManager $manager) { foreach (self::POSITIONS_DATA as [$name, $share, $allowHolder, - $ordering, $ref]) { + $ordering, $ref, ]) { $position = (new Position()) ->setLabel(['fr' => $name]) ->setAllowHolder($allowHolder) diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index c47e72dd6..84d1c1a71 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -857,8 +857,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac $container->prependExtensionConfig( 'chill_custom_fields', ['customizables_entities' => [ - ['class' => 'Chill\PersonBundle\Entity\Person', 'name' => 'PersonEntity'], - ], + ['class' => 'Chill\PersonBundle\Entity\Person', 'name' => 'PersonEntity'], + ], ] ); } diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php index 3bc5375d8..68a8e1fd5 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php @@ -45,14 +45,14 @@ class Configuration implements ConfigurationInterface ->defaultValue('P1D') ->validate() ->ifTrue(function ($period) { - try { - $interval = new DateInterval($period); - } catch (Exception $ex) { - return true; - } + try { + $interval = new DateInterval($period); + } catch (Exception $ex) { + return true; + } - return false; - }) + return false; + }) ->thenInvalid('Invalid period for birthdate validation : "%s" ' . 'The parameter should match duration as defined by ISO8601 : ' . 'https://en.wikipedia.org/wiki/ISO_8601#Durations') diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index f2a72cacc..39b9c3ca3 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -197,7 +197,9 @@ class Household } return -1; - } elseif ($b->getPosition() === null) { + } + + if ($b->getPosition() === null) { return 1; } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php index 75e5ac25e..e57f3f569 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php @@ -119,14 +119,14 @@ class AccompanyingPeriodControllerTest extends WebTestCase $this->assertTrue( $this->client->getResponse()->isRedirect( - '/fr/person/' . $this->person->getId() . '/accompanying-period' - ), + '/fr/person/' . $this->person->getId() . '/accompanying-period' + ), 'the server redirects to /accompanying-period page' ); $this->assertGreaterThan( 0, $this->client->followRedirect() - ->filter('.alert-success')->count(), + ->filter('.alert-success')->count(), "a 'success' element is shown" ); } @@ -159,14 +159,14 @@ class AccompanyingPeriodControllerTest extends WebTestCase $this->assertTrue( $this->client->getResponse()->isRedirect( - '/fr/person/' . $this->person->getId() . '/accompanying-period' - ), + '/fr/person/' . $this->person->getId() . '/accompanying-period' + ), 'the server redirects to /accompanying-period page' ); $this->assertGreaterThan( 0, $this->client->followRedirect() - ->filter('.alert-success')->count(), + ->filter('.alert-success')->count(), "a 'success' element is shown" ); } @@ -204,7 +204,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase $this->assertGreaterThan( 0, $crawlerResponse - ->filter('.alert-danger')->count(), + ->filter('.alert-danger')->count(), "an '.alert-danger' element is shown" ); } @@ -473,10 +473,10 @@ class AccompanyingPeriodControllerTest extends WebTestCase $this->client->request( 'GET', sprintf( - '/fr/person/%d/accompanying-period/%d/re-open', - $this->person->getId(), - $this->person->getOpenedAccompanyingPeriod()->getId() - ) + '/fr/person/%d/accompanying-period/%d/re-open', + $this->person->getId(), + $this->person->getOpenedAccompanyingPeriod()->getId() + ) ); $this->assertEquals( 400, diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php index 55d8fe13a..a06f0b980 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php @@ -117,15 +117,15 @@ class PersonAddressControllerTest extends WebTestCase $this->assertEquals( 1, $crawler - ->filter('div.flash_message.success') - ->count(), + ->filter('div.flash_message.success') + ->count(), 'Asserting that the response page contains a success flash message' ); $this->assertEquals( 1, $crawler - ->filter('td:contains("Rue de la Paix, 50")') - ->count(), + ->filter('td:contains("Rue de la Paix, 50")') + ->count(), 'Asserting that the page contains the new address' ); } @@ -140,7 +140,7 @@ class PersonAddressControllerTest extends WebTestCase $this->assertEquals( 1, $crawler->filter('td:contains("Pas d\'adresse renseignée")') - ->count(), + ->count(), "assert that a message say 'no address given'" ); } @@ -175,15 +175,15 @@ class PersonAddressControllerTest extends WebTestCase $this->assertGreaterThan( 0, $crawler - ->filter('div.flash_message.success') - ->count(), + ->filter('div.flash_message.success') + ->count(), 'Asserting that the response page contains a success flash message' ); $this->assertEquals( 1, $crawler - ->filter('td:contains("Rue du Trou Normand")') - ->count(), + ->filter('td:contains("Rue du Trou Normand")') + ->count(), 'Asserting that the page contains the new address' ); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php index 57d96e7d2..c7ae0d4d4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php @@ -26,9 +26,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; */ class PersonVoterTest extends KernelTestCase { - use PrepareUserTrait; use PrepareCenterTrait; use PrepareScopeTrait; + use PrepareUserTrait; /** * @var \Prophecy\Prophet diff --git a/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php b/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php index 34079a4d7..9e755163d 100644 --- a/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php +++ b/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php @@ -22,8 +22,7 @@ class AddAPersonWidget implements WidgetInterface $place, array $context, array $config - ) - { + ) { return $env->render('ChillPersonBundle:Widget:homepage_add_a_person.html.twig'); } } diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php index e2281e1b5..1d59a9732 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php @@ -59,8 +59,7 @@ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInt ObjectManager $manager, array $name, array $options = [] - ) - { + ) { echo $name['fr'] . " \n"; $cFGroup = (new CustomFieldsGroup()) diff --git a/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php b/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php index 80ce16fa6..8e0294d43 100644 --- a/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php +++ b/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php @@ -38,19 +38,19 @@ class ChillReportExtension extends Extension implements PrependExtensionInterfac $container->prependExtensionConfig( 'chill_custom_fields', ['customizables_entities' => [ - [ - 'class' => 'Chill\ReportBundle\Entity\Report', - 'name' => 'ReportEntity', - 'options' => [ - 'summary_fields' => [ - 'form_type' => LinkedCustomFieldsType::class, - 'form_options' => [ - 'multiple' => true, - 'expanded' => false, - ], + [ + 'class' => 'Chill\ReportBundle\Entity\Report', + 'name' => 'ReportEntity', + 'options' => [ + 'summary_fields' => [ + 'form_type' => LinkedCustomFieldsType::class, + 'form_options' => [ + 'multiple' => true, + 'expanded' => false, ], - ], ], - ], + ], + ], ], + ], ] ); } diff --git a/src/Bundle/ChillReportBundle/Form/ReportType.php b/src/Bundle/ChillReportBundle/Form/ReportType.php index da81fe1c2..52efd0892 100644 --- a/src/Bundle/ChillReportBundle/Form/ReportType.php +++ b/src/Bundle/ChillReportBundle/Form/ReportType.php @@ -49,8 +49,7 @@ class ReportType extends AbstractType TokenStorageInterface $tokenStorage, TranslatableStringHelper $translatableStringHelper, ObjectManager $om - ) - { + ) { $this->authorizationHelper = $helper; $this->user = $tokenStorage->getToken()->getUser(); $this->translatableStringHelper = $translatableStringHelper; diff --git a/src/Bundle/ChillReportBundle/Search/ReportSearch.php b/src/Bundle/ChillReportBundle/Search/ReportSearch.php index 45f8c5705..b770d2fa3 100644 --- a/src/Bundle/ChillReportBundle/Search/ReportSearch.php +++ b/src/Bundle/ChillReportBundle/Search/ReportSearch.php @@ -46,8 +46,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface EntityManagerInterface $em, AuthorizationHelper $helper, TokenStorageInterface $tokenStorage - ) - { + ) { $this->em = $em; $this->helper = $helper; @@ -99,9 +98,9 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface ); $whereElement->add( $qb->expr()->andX( - $qb->expr()->eq('p.center', ':center_' . $i), - $qb->expr()->in('r.scope', ':reachable_scopes_' . $i) - ) + $qb->expr()->eq('p.center', ':center_' . $i), + $qb->expr()->in('r.scope', ':reachable_scopes_' . $i) + ) ); $qb->setParameter('center_' . $i, $center); $qb->setParameter('reachable_scopes_' . $i, $reachableScopesId); diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php index 694daf9c1..0030b2444 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php @@ -66,8 +66,8 @@ class ReportControllerNextTest extends WebTestCase $filteredCustomFieldsGroupHouse = array_filter( $customFieldsGroups, function (CustomFieldsGroup $group) { - return in_array('Situation de logement', $group->getName()); - } + return in_array('Situation de logement', $group->getName()); + } ); $this->group = $filteredCustomFieldsGroupHouse[0]; } diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index 6a80d8759..4aa6d871b 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -83,8 +83,8 @@ class ReportControllerTest extends WebTestCase $filteredCustomFieldsGroupHouse = array_filter( $customFieldsGroups, function (CustomFieldsGroup $group) { - return in_array('Situation de logement', $group->getName()); - } + return in_array('Situation de logement', $group->getName()); + } ); static::$group = $filteredCustomFieldsGroupHouse[0]; @@ -136,7 +136,7 @@ class ReportControllerTest extends WebTestCase $this->assertGreaterThan( 1, count($form->get(self::REPORT_NAME_FIELD) - ->availableOptionValues()), + ->availableOptionValues()), 'I can choose between report models' ); @@ -253,9 +253,9 @@ class ReportControllerTest extends WebTestCase ); $this->assertContains( sprintf( - '/fr/person/%d/report/select/type/for/creation', - static::$person->getId() - ), + '/fr/person/%d/report/select/type/for/creation', + static::$person->getId() + ), $link->getUri(), 'There is a "add a report" link in menu' ); @@ -334,10 +334,10 @@ class ReportControllerTest extends WebTestCase $this->assertTrue($client->getResponse()->isRedirect( sprintf( - '/fr/person/%s/report/%s/view', - static::$person->getId(), - $reportId - ) + '/fr/person/%s/report/%s/view', + static::$person->getId(), + $reportId + ) )); $this->assertEquals(new DateTime('yesterday'), static::$kernel->getContainer() @@ -416,8 +416,7 @@ class ReportControllerTest extends WebTestCase Person $person, CustomFieldsGroup $group, \Symfony\Component\BrowserKit\Client $client - ) - { + ) { $url = sprintf( 'fr/person/%d/report/cfgroup/%d/new', $person->getId(), diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 361611294..f24f9e721 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -25,9 +25,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; */ class ReportVoterTest extends KernelTestCase { - use PrepareUserTrait; use PrepareCenterTrait; use PrepareScopeTrait; + use PrepareUserTrait; /** * @var \Prophecy\Prophet @@ -131,8 +131,7 @@ class ReportVoterTest extends KernelTestCase $action, $message, ?User $user = null - ) - { + ) { $token = $this->prepareToken($user); $result = $this->voter->vote($token, $report, [$action]); $this->assertEquals($expectedResult, $result, $message); diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index 584ee181c..f49f42d3d 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -62,8 +62,8 @@ class TimelineProviderTest extends WebTestCase $scopesSocial = array_filter( static::$em - ->getRepository('ChillMainBundle:Scope') - ->findAll(), + ->getRepository('ChillMainBundle:Scope') + ->findAll(), function (Scope $scope) { return $scope->getName()['en'] === 'social'; } ); @@ -104,7 +104,7 @@ class TimelineProviderTest extends WebTestCase $this->assertEquals( 0, $crawler->filter('.report_entry .summary') - ->count(), + ->count(), 'the page does not contains a .report .summary element' ); } @@ -152,19 +152,19 @@ class TimelineProviderTest extends WebTestCase $this->assertGreaterThan( 0, $crawler->filter('.report_entry .summary') - ->count(), + ->count(), 'the page contains a .report .summary element' ); $this->assertContains( 'blah blah', $crawler->filter('.report_entry .summary') - ->text(), + ->text(), 'the page contains the text "blah blah"' ); $this->assertContains( 'Propriétaire', $crawler->filter('.report_entry .summary') - ->text(), + ->text(), 'the page contains the mention "Propriétaire"' ); } diff --git a/src/Bundle/ChillTaskBundle/Controller/TaskController.php b/src/Bundle/ChillTaskBundle/Controller/TaskController.php index 712e242df..498997abc 100644 --- a/src/Bundle/ChillTaskBundle/Controller/TaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/TaskController.php @@ -92,8 +92,8 @@ class TaskController extends AbstractController array_filter( $workflow->getEnabledTransitions($task), function (Transition $t) use ($transition) { - return $t->getName() === $transition; - } + return $t->getName() === $transition; + } ))[0]; $form = $this->createTransitionForm($task); diff --git a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php index bdd8af6a9..d97980efe 100644 --- a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php @@ -31,8 +31,7 @@ class MenuBuilder implements LocalMenuBuilderInterface public function __construct( AuthorizationCheckerInterface $authorizationChecker, TranslatorInterface $translator - ) - { + ) { $this->translator = $translator; $this->authorizationChecker = $authorizationChecker; } diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index 4beba0baa..6314b19c9 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -255,8 +255,8 @@ class SingleTaskRepository extends EntityRepository return $qb->expr()->orX() ->add( $qb->expr()->andX() - ->add($qb->expr()->isNotNull('st.endDate')) - ->add($qb->expr()->gt('st.endDate', ':now')) + ->add($qb->expr()->isNotNull('st.endDate')) + ->add($qb->expr()->gt('st.endDate', ':now')) ) ->add($qb->expr()->isNull('st.endDate')); } @@ -281,23 +281,23 @@ class SingleTaskRepository extends EntityRepository return $qb->expr()->andX() ->add( $qb->expr()->lte( - $qb->expr()->diff('st.endDate', 'st.warningInterval'), - ':now' - ) + $qb->expr()->diff('st.endDate', 'st.warningInterval'), + ':now' + ) ); } return $qb->expr()->orX() ->add( $qb->expr()->andX() - ->add($qb->expr()->isNotNull('st.endDate')) - ->add($qb->expr()->isNotNull('st.warningInterval')) - ->add( - $qb->expr()->gt( - $qb->expr()->diff('st.endDate', 'st.warningInterval'), - ':now' - ) - ) + ->add($qb->expr()->isNotNull('st.endDate')) + ->add($qb->expr()->isNotNull('st.warningInterval')) + ->add( + $qb->expr()->gt( + $qb->expr()->diff('st.endDate', 'st.warningInterval'), + ':now' + ) + ) ) ->add($qb->expr()->isNull('st.endDate')) ->add($qb->expr()->isNull('st.warningInterval')); diff --git a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php index b9b4368c6..af0f7de06 100644 --- a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php +++ b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php @@ -32,8 +32,6 @@ class ThirdPartyTypeManager * Method used during the load of the manager by Dependency Injection * * @param \Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface $provider - * - * @return self */ public function addProvider(ThirdPartyTypeProviderInterface $provider): self {