From c8195e6df5c0040b37e06d31731d82dbc4ce2239 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 30 Nov 2021 11:28:52 +0100 Subject: [PATCH] cs: Enable more risky rules. --- .php_cs.dist.php | 10 +++++----- .../controller-secured-for-person.php | 4 ++-- ...ChillPersonAddAPersonListWidgetFactory.php | 8 ++++---- .../ChillActivityExtension.php | 2 +- .../ChillActivityBundle/Entity/Activity.php | 12 ++++++------ .../Export/Filter/ActivityDateFilter.php | 2 +- .../PersonHavingActivityBetweenDateFilter.php | 2 +- .../ChillActivityBundle/Form/ActivityType.php | 2 +- .../Form/Type/TranslatableActivityType.php | 2 +- .../Menu/PersonMenuBuilder.php | 2 +- .../Tests/Export/Export/CountActivityTest.php | 2 +- .../Tests/Export/Export/ListActivityTest.php | 2 +- .../Export/StatActivityDurationSumTest.php | 2 +- .../Tests/Form/ActivityTypeTest.php | 4 ++-- .../src/Form/AsideActivityFormType.php | 3 ++- .../src/Menu/UserMenuBuilder.php | 2 +- .../Controller/AbstractElementController.php | 2 +- .../ChillAMLIBudgetExtension.php | 2 +- .../Menu/UserMenuBuilder.php | 2 +- .../Controller/CalendarController.php | 2 +- .../Menu/UserMenuBuilder.php | 2 +- .../ChillCustomFieldsExtension.php | 2 +- .../Form/Type/ChoiceWithOtherType.php | 4 ++-- .../Form/Type/ChoicesListType.php | 5 ++--- .../Service/CustomFieldProvider.php | 5 +++-- .../Twig/CustomFieldRenderingTwig.php | 12 +++++++----- .../Twig/CustomFieldsGroupRenderingTwig.php | 12 +++++++----- .../ChillDocStoreBundle/Menu/MenuBuilder.php | 2 +- .../Controller/EventController.php | 4 ++-- .../Controller/ParticipationController.php | 8 ++++---- .../DataFixtures/ORM/LoadParticipation.php | 2 +- .../ChillEventExtension.php | 2 +- .../Form/ChoiceLoader/EventChoiceLoader.php | 7 ++----- .../Menu/PersonMenuBuilder.php | 2 +- .../ParticipationControllerTest.php | 2 +- .../Tests/Search/EventSearchTest.php | 10 +++++----- .../ChillAMLIFamilyMembersExtension.php | 2 +- .../Menu/UserMenuBuilder.php | 2 +- .../ChillUserSendRenewPasswordCodeCommand.php | 2 +- .../Command/LoadAndUpdateLanguagesCommand.php | 10 ++++++---- .../Command/LoadCountriesCommand.php | 10 ++++++---- .../Controller/ExportController.php | 8 ++++---- .../Controller/PasswordController.php | 2 +- .../Controller/PermissionsGroupController.php | 8 ++++---- .../Controller/SearchController.php | 6 +++--- .../SearchableServicesCompilerPass.php | 5 +++-- .../Widget/AbstractWidgetsCompilerPass.php | 6 +++--- .../ChillMainBundle/Export/ExportManager.php | 2 +- .../Export/Formatter/CSVFormatter.php | 6 +++--- .../ChillMainBundle/Search/SearchProvider.php | 3 +-- .../Templating/CSVCellTwig.php | 14 ++++++++------ .../Templating/TranslatableStringTwig.php | 5 +++-- .../Templating/Widget/WidgetRenderingTwig.php | 2 +- .../Test/Export/AbstractExportTest.php | 2 +- .../Tests/Controller/UserControllerTest.php | 2 +- .../Entity/UserCircleConsistencyValidator.php | 2 +- .../Command/ImportPeopleFromCSVCommand.php | 12 ++++++------ .../AccompanyingPeriodController.php | 2 +- .../DataFixtures/ORM/LoadCustomFields.php | 2 +- .../Export/Export/ListPerson.php | 2 +- .../ChillPersonBundle/Search/PersonSearch.php | 19 +++++++++++++------ .../AccompanyingPeriodControllerTest.php | 2 +- .../Export/Export/ReportList.php | 2 +- .../ChillTaskBundle/Menu/UserMenuBuilder.php | 2 +- .../Templating/UI/CountNotificationTask.php | 2 +- 65 files changed, 155 insertions(+), 139 deletions(-) diff --git a/.php_cs.dist.php b/.php_cs.dist.php index 6b7c1ddb9..936664f92 100644 --- a/.php_cs.dist.php +++ b/.php_cs.dist.php @@ -23,12 +23,12 @@ $rules = $config->getRules(); $riskyRules = [ 'final_internal_class' => false, // 'no_useless_sprintf' => false, - 'dir_constant' => false, + // 'dir_constant' => false, // 'no_alias_functions' => false, // 'implode_call' => false, - 'combine_nested_dirname' => false, + // 'combine_nested_dirname' => false, // 'pow_to_exponentiation' => false, - 'comment_to_phpdoc' => false, + // 'comment_to_phpdoc' => false, // 'no_unset_on_property' => false, 'strict_param' => false, 'native_constant_invocation' => false, @@ -36,7 +36,7 @@ $riskyRules = [ 'php_unit_no_expectation_annotation' => false, 'declare_strict_types' => false, 'function_to_constant' => false, - 'is_null' => true, + // 'is_null' => false, 'native_function_invocation' => false, 'ternary_to_elvis_operator' => false, // 'no_trailing_whitespace_in_string' => false, @@ -57,7 +57,7 @@ $riskyRules = [ 'php_unit_mock_short_will_return' => false, 'php_unit_set_up_tear_down_visibility' => false, 'set_type_to_cast' => false, - 'string_line_ending' => false, + // 'string_line_ending' => false, 'ordered_interfaces' => false, 'php_unit_expectation' => false, 'php_unit_mock' => false, diff --git a/docs/source/development/useful-snippets/controller-secured-for-person.php b/docs/source/development/useful-snippets/controller-secured-for-person.php index 126a8cad4..dab116cef 100644 --- a/docs/source/development/useful-snippets/controller-secured-for-person.php +++ b/docs/source/development/useful-snippets/controller-secured-for-person.php @@ -25,7 +25,7 @@ class ConsultationController extends Controller */ public function listAction($id) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $this->get('chill.person.repository.person') ->find($id); @@ -35,7 +35,7 @@ class ConsultationController extends Controller $this->denyAccessUnlessGranted(PersonVoter::SEE, $person); - /* @var $authorizationHelper \Chill\MainBundle\Security\Authorization\AuthorizationHelper */ + /** @var \Chill\MainBundle\Security\Authorization\AuthorizationHelper $authorizationHelper */ $authorizationHelper = $this->get('chill.main.security.' . 'authorization.helper'); diff --git a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php index f3a93a3e6..16020bd78 100644 --- a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php +++ b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php @@ -36,8 +36,8 @@ class PersonListWidgetFactory extends AbstractWidgetFactory ->end(); } - /* - * return an array with the allowed places where the widget can be rendered + /** + * return an array with the allowed places where the widget can be rendered. * * @return string[] */ @@ -59,8 +59,8 @@ class PersonListWidgetFactory extends AbstractWidgetFactory return 'chill_person.widget.person_list'; } - /* - * return the widget alias + /** + * return the widget alias. * * @return string */ diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php index 548d34a09..cec67e671 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php @@ -67,7 +67,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf ]); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ public function prependRoutes(ContainerBuilder $container) diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 07b88fcae..45777dc09 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -45,14 +45,14 @@ use Symfony\Component\Serializer\Annotation\SerializedName; * @ActivityValidator\ActivityValidity */ -/* - * TODO : revoir +/** + * TODO : revoir. + * * @UserCircleConsistency( - * "CHILL_ACTIVITY_SEE_DETAILS", - * getUserFunction="getUser", - * path="scope") + * "CHILL_ACTIVITY_SEE_DETAILS", + * getUserFunction="getUser", + * path="scope") */ - class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface { public const SENTRECEIVED_RECEIVED = 'received'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index fd207b22c..00a9ac382 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -89,7 +89,7 @@ class ActivityDateFilter implements FilterInterface ); $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { - /* @var $filterForm \Symfony\Component\Form\FormInterface */ + /** @var \Symfony\Component\Form\FormInterface $filterForm */ $filterForm = $event->getForm()->getParent(); $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php index 5338a0f21..32fd8e76f 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php @@ -134,7 +134,7 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportEl ]); $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { - /* @var FormInterface $filterForm */ + /** @var FormInterface $filterForm */ $filterForm = $event->getForm()->getParent(); $enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData(); diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 5cba5ad57..5c72e3556 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -374,7 +374,7 @@ class ActivityType extends AbstractType // set the timezone to GMT, and fix the difference between current and GMT // the datetimetransformer will then handle timezone as GMT $timezoneUTC = new DateTimeZone('GMT'); - /* @var $data \DateTime */ + /** @var DateTime $data */ $data = $formEvent->getData() === null ? DateTime::createFromFormat('U', 300) : $formEvent->getData(); diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php index 6b677ada2..dc6328709 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php @@ -37,7 +37,7 @@ class TranslatableActivityType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - /* @var QueryBuilder $qb */ + /** @var QueryBuilder $qb */ $qb = $options['query_builder']; if (true === $options['active_only']) { diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index d5ae9c528..23df91954 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -37,7 +37,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person']; if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php index 00bb1b945..ffc13f6b3 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php @@ -26,7 +26,7 @@ class CountActivityTest extends AbstractExportTest { static::bootKernel(); - /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ $container = self::$kernel->getContainer(); $this->export = $container->get('chill.activity.export.count_activity'); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php index bcc9fb034..c71aee64f 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php @@ -26,7 +26,7 @@ class ListActivityTest extends AbstractExportTest { static::bootKernel(); - /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ $container = self::$kernel->getContainer(); $this->export = $container->get('chill.activity.export.list_activity'); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php index 963ecbaaa..ce8d2e312 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php @@ -28,7 +28,7 @@ class StatActivityDurationSumTest extends AbstractExportTest { static::bootKernel(); - /* @var $container \Symfony\Component\DependencyInjection\ContainerInterface */ + /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ $container = self::$kernel->getContainer(); $this->export = $container->get('chill.activity.export.sum_activity_duration'); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php index a00ccdbf7..2e6d97ea9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php @@ -119,7 +119,7 @@ class ActivityTypeTest extends KernelTestCase $this->assertInstanceOf(Activity::class, $form->getData()['activity']); // test the activity - /* @var $activity Activity */ + /** @var Activity $activity */ $activity = $form->getData()['activity']; $this->assertEquals( @@ -170,7 +170,7 @@ class ActivityTypeTest extends KernelTestCase $this->assertTrue($form->isValid()); // test the activity - /* @var $activity Activity */ + /** @var Activity $activity */ $activity = $form->getData()['activity']; $this->assertEquals( diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index efc368ecc..d0ce5773c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -17,6 +17,7 @@ use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillTextareaType; use DateInterval; use DateTime; +use DateTimeImmutable; use DateTimeZone; use Doctrine\ORM\EntityRepository; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -131,7 +132,7 @@ final class AsideActivityFormType extends AbstractType // set the timezone to GMT, and fix the difference between current and GMT // the datetimetransformer will then handle timezone as GMT $timezoneUTC = new DateTimeZone('GMT'); - /* @var $data \DateTimeImmutable */ + /** @var DateTimeImmutable $data */ $data = $formEvent->getData() === null ? DateTime::createFromFormat('U', 300) : $formEvent->getData(); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php index e7d6f5e67..39a6f6acd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php @@ -28,7 +28,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface */ public $counter; - /* + /** * @var TokenStorageInterface */ public $tokenStorage; diff --git a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php index 55a2cc165..cc019676e 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php @@ -135,7 +135,7 @@ abstract class AbstractElementController extends Controller */ protected function _new(Person $person, Request $request, $template, $flashMessageOnSuccess) { - /* @var $element \Chill\AMLI\BudgetBundle\Entity\AbstractElement */ + /** @var \Chill\AMLI\BudgetBundle\Entity\AbstractElement $element */ $element = $this->createNewElement() ->setPerson($person); diff --git a/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillAMLIBudgetExtension.php b/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillAMLIBudgetExtension.php index 9ef18763f..66b301dec 100644 --- a/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillAMLIBudgetExtension.php +++ b/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillAMLIBudgetExtension.php @@ -47,7 +47,7 @@ class ChillAMLIBudgetExtension extends Extension implements PrependExtensionInte $this->prependRoutes($container); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ public function prependRoutes(ContainerBuilder $container) diff --git a/src/Bundle/ChillBudgetBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/UserMenuBuilder.php index 7b8705511..c5701b5ce 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/UserMenuBuilder.php @@ -37,7 +37,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person']; if ($this->authorizationChecker->isGranted(BudgetElementVoter::SHOW, $person)) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index cde6bc7b4..68640f3f4 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -80,7 +80,7 @@ class CalendarController extends AbstractController $view = '@ChillCalendar/Calendar/confirm_deleteByUser.html.twig'; } - /* @var $entity Calendar */ + /** @var Calendar $entity */ $entity = $em->getRepository('ChillCalendarBundle:Calendar')->find($id); if (!$entity) { diff --git a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php index 6561808fc..0fe9baecb 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php @@ -28,7 +28,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface */ public $counter; - /* + /** * @var TokenStorageInterface */ public $tokenStorage; diff --git a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php index f8cf11e8e..9e4590a70 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php +++ b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php @@ -48,7 +48,7 @@ class ChillCustomFieldsExtension extends Extension implements PrependExtensionIn ); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php index debc3cdf5..c8845139a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php @@ -22,7 +22,7 @@ class ChoiceWithOtherType extends AbstractType { private $otherValueLabel = 'Other value'; - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::buildForm() */ public function buildForm(FormBuilderInterface $builder, array $options) @@ -39,7 +39,7 @@ class ChoiceWithOtherType extends AbstractType ->add('_choices', ChoiceType::class, $options); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::configureOptions() */ public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php index a005af73c..7fd4da821 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormEvents; class ChoicesListType extends AbstractType { - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::buildForm() */ public function buildForm(FormBuilderInterface $builder, array $options) @@ -48,8 +48,7 @@ class ChoicesListType extends AbstractType }); } - /* - * + /** * @see \Symfony\Component\Form\FormTypeInterface::getName() */ public function getBlockPrefix() diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php index 25e021f3c..955421abc 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php @@ -79,8 +79,9 @@ class CustomFieldProvider implements ContainerAwareInterface . 'is not found'); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ public function setContainer(?ContainerInterface $container = null) diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php index 9f0e94940..d7e3ad444 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php @@ -46,8 +46,9 @@ class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwa $this->customFieldsHelper = $customFieldsHelper; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see Twig_Extension::getFunctions() */ public function getFunctions() @@ -76,7 +77,7 @@ class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwa ]; } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see Twig_ExtensionInterface::getName() */ public function getName() @@ -123,8 +124,9 @@ class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwa ->renderCustomField($fields, $customField, $documentType); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ public function setContainer(?ContainerInterface $container = null) diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php index 1de69e15a..f1c49551c 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php @@ -43,8 +43,9 @@ class CustomFieldsGroupRenderingTwig extends AbstractExtension implements Contai $this->defaultParams['show_empty'] = $showEmptyValues; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see Twig_Extension::getFunctions() */ public function getFunctions() @@ -61,7 +62,7 @@ class CustomFieldsGroupRenderingTwig extends AbstractExtension implements Contai ]; } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see Twig_ExtensionInterface::getName() */ public function getName() @@ -96,8 +97,9 @@ class CustomFieldsGroupRenderingTwig extends AbstractExtension implements Contai 'show_empty' => $resolvedParams['show_empty'], ]); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ public function setContainer(?ContainerInterface $container = null) diff --git a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php index a26e1467f..d266cc1b1 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php @@ -73,7 +73,7 @@ final class MenuBuilder implements LocalMenuBuilderInterface private function buildMenuPerson(MenuItem $menu, array $parameters) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person']; if ($this->security->isGranted(PersonDocumentVoter::SEE, $person)) { diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 06307706b..7c519432a 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -379,7 +379,7 @@ class EventController extends AbstractController */ protected function createAddEventParticipationByPersonForm(Person $person) { - /* @var $builder \Symfony\Component\Form\FormBuilderInterface */ + /** @var \Symfony\Component\Form\FormBuilderInterface $builder */ $builder = $this ->get('form.factory') ->createNamedBuilder( @@ -426,7 +426,7 @@ class EventController extends AbstractController */ protected function createAddParticipationByPersonForm(Event $event) { - /* @var $builder \Symfony\Component\Form\FormBuilderInterface */ + /** @var \Symfony\Component\Form\FormBuilderInterface $builder */ $builder = $this ->get('form.factory') ->createNamedBuilder( diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index e719ba91e..4ddaf7cae 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -298,7 +298,7 @@ class ParticipationController extends AbstractController */ public function editAction(int $participation_id): Response { - /* @var $participation Participation */ + /** @var Participation $participation */ $participation = $this->getDoctrine()->getManager() ->getRepository(Participation::class) ->find($participation_id); @@ -419,7 +419,7 @@ class ParticipationController extends AbstractController public function updateAction(int $participation_id, Request $request): Response { - /* @var $participation Participation */ + /** @var Participation $participation */ $participation = $this->getDoctrine()->getManager() ->getRepository(Participation::class) ->find($participation_id); @@ -460,7 +460,7 @@ class ParticipationController extends AbstractController public function updateMultipleAction($event_id, Request $request) { - /* @var $event \Chill\EventBundle\Entity\Event */ + /** @var \Chill\EventBundle\Entity\Event $event */ $event = $this->getDoctrine()->getRepository('ChillEventBundle:Event') ->find($event_id); @@ -642,7 +642,7 @@ class ParticipationController extends AbstractController ); // create a collection of person's id participating to the event - /* @var $peopleParticipating \Doctrine\Common\Collections\ArrayCollection */ + /** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */ $peopleParticipating = $peopleParticipating ?? $participation->getEvent()->getParticipations()->map( function (Participation $p) { return $p->getPerson()->getId(); } diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index bd0234740..2496f04fc 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -70,7 +70,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa ->findBy(['center' => $center]); $events = $this->createEvents($center, $manager); - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ foreach ($people as $person) { $nb = rand(0, 3); diff --git a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php index dc20a27a5..f46485f47 100644 --- a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php +++ b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php @@ -40,7 +40,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface $loader->load('services/timeline.yaml'); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php index 4d9d41a22..807660b9e 100644 --- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php +++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php @@ -17,11 +17,8 @@ use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface; use function call_user_func; use function in_array; -/* - * Class EventChoiceLoader - * - * @package Chill\EventBundle\Form\ChoiceLoader - * @author Mathieu Jaumotte jaum_mathieu@collectifs.net +/** + * Class EventChoiceLoader. */ class EventChoiceLoader implements ChoiceLoaderInterface { diff --git a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php index c9f5f96b4..bf5b5f22c 100644 --- a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php @@ -37,7 +37,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person'] ?? null; if ($this->authorizationChecker->isGranted(EventVoter::SEE, $person)) { diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php index f03b5a5ba..ee896a0af 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php @@ -134,7 +134,7 @@ class ParticipationControllerTest extends WebTestCase public function testEditMultipleAction() { - /* @var $event \Chill\EventBundle\Entity\Event */ + /** @var \Chill\EventBundle\Entity\Event $event */ $event = $this->getRandomEventWithMultipleParticipations(); $crawler = $this->client->request('GET', '/fr/event/participation/' . $event->getId() . diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index edb388cd7..a7000050e 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -68,7 +68,7 @@ class EventSearchTest extends WebTestCase public function setUp() { self::bootKernel(); - /* @var $kernel \Symfony\Component\HttpKernel\KernelInterface */ + /** @var \Symfony\Component\HttpKernel\KernelInterface $kernel */ $kernel = self::$kernel; $this->client = static::createClient([], [ @@ -147,7 +147,7 @@ class EventSearchTest extends WebTestCase 'q' => '@events date-from:2016-05-30 date-to:2016-06-20', ]); - /* @var $dateFrom \DateTime the date from in DateTime */ + /** @var DateTime $dateFrom the date from in DateTime */ $dateFrom = DateTime::createFromFormat('Y-m-d', '2016-05-30'); $dateTo = DateTime::createFromFormat('Y-m-d', '2016-06-20'); @@ -193,7 +193,7 @@ class EventSearchTest extends WebTestCase $crawler = $this->client->request('GET', '/fr/search', [ 'q' => '@events date-from:2016-05-30', ]); - /* @var $dateFrom \DateTime the date from in DateTime */ + /** @var DateTime $dateFrom the date from in DateTime */ $dateFrom = DateTime::createFromFormat('Y-m-d', '2016-05-30'); $dates = $this->iterateOnRowsToFindDate($crawler->filter('tr')); @@ -229,7 +229,7 @@ class EventSearchTest extends WebTestCase 'q' => '@events date:2016-05-30', ]); - /* @var $dateFrom \DateTime the date from in DateTime */ + /** @var DateTime $dateFrom the date from in DateTime */ $dateTo = DateTime::createFromFormat('Y-m-d', '2016-05-30'); $dates = $this->iterateOnRowsToFindDate($crawler->filter('tr')); @@ -333,7 +333,7 @@ class EventSearchTest extends WebTestCase $circles = $this->entityManager->getRepository('ChillMainBundle:Scope') ->findAll(); - /* @var $circle \Chill\MainBundle\Entity\Scope */ + /** @var \Chill\MainBundle\Entity\Scope $circle */ foreach ($circles as $circle) { if (in_array($name, $circle->getName())) { return $circle; diff --git a/src/Bundle/ChillFamilyMembersBundle/DependencyInjection/ChillAMLIFamilyMembersExtension.php b/src/Bundle/ChillFamilyMembersBundle/DependencyInjection/ChillAMLIFamilyMembersExtension.php index 3e595dcb6..463359652 100644 --- a/src/Bundle/ChillFamilyMembersBundle/DependencyInjection/ChillAMLIFamilyMembersExtension.php +++ b/src/Bundle/ChillFamilyMembersBundle/DependencyInjection/ChillAMLIFamilyMembersExtension.php @@ -45,7 +45,7 @@ class ChillAMLIFamilyMembersExtension extends Extension implements PrependExtens $this->prependRoutes($container); } - /* (non-PHPdoc) + /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ public function prependRoutes(ContainerBuilder $container) diff --git a/src/Bundle/ChillFamilyMembersBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillFamilyMembersBundle/Menu/UserMenuBuilder.php index 565198894..ed1f5d927 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillFamilyMembersBundle/Menu/UserMenuBuilder.php @@ -37,7 +37,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /* @var $person \Chill\PersonBundle\Entity\Person */ + /** @var \Chill\PersonBundle\Entity\Person $person */ $person = $parameters['person']; if ($this->authorizationChecker->isGranted(FamilyMemberVoter::SHOW, $person)) { diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php index 0a78f8c59..cf00171dc 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php @@ -150,7 +150,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command protected function getUser($row) { - /* @var $userRepository \Chill\MainBundle\Repository\UserRepository */ + /** @var \Chill\MainBundle\Repository\UserRepository $userRepository */ $userRepository = $this->em->getRepository(User::class); try { diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index 4b1f541a5..d1a3c3cdb 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -52,8 +52,9 @@ class LoadAndUpdateLanguagesCommand extends Command parent::__construct(); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\Console\Command\Command::configure() */ protected function configure() @@ -78,8 +79,9 @@ class LoadAndUpdateLanguagesCommand extends Command ); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\Console\Command\Command::execute() */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index 9ef4f70ff..8846ecb91 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -62,8 +62,9 @@ class LoadCountriesCommand extends Command return $countryEntities; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\Console\Command\Command::configure() */ protected function configure() @@ -73,8 +74,9 @@ class LoadCountriesCommand extends Command 'but will update names according to available languages'); } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\Console\Command\Command::execute() */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index ae5adb94f..0ef79cf7a 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -80,7 +80,7 @@ class ExportController extends AbstractController public function downloadResultAction(Request $request, $alias) { - /* @var $exportManager \Chill\MainBundle\Export\ExportManager */ + /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; $key = $request->query->get('key', null); @@ -118,7 +118,7 @@ class ExportController extends AbstractController */ public function generateAction(Request $request, $alias) { - /* @var $exportManager \Chill\MainBundle\Export\ExportManager */ + /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; $key = $request->query->get('key', null); @@ -212,7 +212,7 @@ class ExportController extends AbstractController */ protected function createCreateFormExport($alias, $step, $data = []) { - /* @var $exportManager \Chill\MainBundle\Export\ExportManager */ + /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; $isGenerate = strpos($step, 'generate_') === 0; @@ -466,7 +466,7 @@ class ExportController extends AbstractController */ protected function selectCentersStep(Request $request, $export, $alias) { - /* @var $exportManager \Chill\MainBundle\Export\ExportManager */ + /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; $form = $this->createCreateFormExport($alias, 'centers'); diff --git a/src/Bundle/ChillMainBundle/Controller/PasswordController.php b/src/Bundle/ChillMainBundle/Controller/PasswordController.php index e8139c4cf..32ab13f25 100644 --- a/src/Bundle/ChillMainBundle/Controller/PasswordController.php +++ b/src/Bundle/ChillMainBundle/Controller/PasswordController.php @@ -175,7 +175,7 @@ class PasswordController extends AbstractController $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - /* @var $qb \Doctrine\ORM\QueryBuilder */ + /** @var \Doctrine\ORM\QueryBuilder $qb */ $qb = $this->getDoctrine()->getManager() ->createQueryBuilder(); $qb->select('u') diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 393849776..9d9a9f70a 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -143,7 +143,7 @@ class PermissionsGroupController extends AbstractController $roleScopesSorted = []; foreach ($permissionsGroup->getRoleScopes()->toArray() as $roleScope) { - /* @var $roleScope RoleScope */ + /** @var RoleScope $roleScope */ $title = $roleProvider->getRoleTitle($roleScope->getRole()); $roleScopesSorted[$title][] = $roleScope; } @@ -290,7 +290,7 @@ class PermissionsGroupController extends AbstractController $roleScopesSorted = []; foreach ($permissionsGroup->getRoleScopes()->toArray() as $roleScope) { - /* @var $roleScope RoleScope */ + /** @var RoleScope $roleScope */ $title = $roleProvider->getRoleTitle($roleScope->getRole()); $roleScopesSorted[$title][] = $roleScope; } @@ -378,7 +378,7 @@ class PermissionsGroupController extends AbstractController $roleScopesSorted = []; foreach ($roleScopes as $roleScope) { - /* @var $roleScope RoleScope */ + /** @var RoleScope $roleScope */ $title = $roleProvider->getRoleTitle($roleScope->getRole()); $roleScopesSorted[$title][] = $roleScope; } @@ -434,7 +434,7 @@ class PermissionsGroupController extends AbstractController $roleScopesSorted = []; foreach ($permissionsGroup->getRoleScopes()->toArray() as $roleScope) { - /* @var $roleScope RoleScope */ + /** @var RoleScope $roleScope */ $title = $roleProvider->getRoleTitle($roleScope->getRole()); $roleScopesSorted[$title][] = $roleScope; } diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index 7d1a08f46..ddd55237d 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -56,9 +56,9 @@ class SearchController extends AbstractController public function advancedSearchAction($name, Request $request) { try { - /* @var $variable Chill\MainBundle\Search\SearchProvider */ + /** @var Chill\MainBundle\Search\SearchProvider $variable */ $searchProvider = $this->searchProvider; - /* @var $variable Chill\MainBundle\Search\HasAdvancedSearchFormInterface */ + /** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */ $search = $this->searchProvider ->getHasAdvancedFormByName($name); } catch (\Chill\MainBundle\Search\UnknowSearchNameException $e) { @@ -100,7 +100,7 @@ class SearchController extends AbstractController public function advancedSearchListAction(Request $request) { - /* @var $variable Chill\MainBundle\Search\SearchProvider */ + /** @var Chill\MainBundle\Search\SearchProvider $variable */ $searchProvider = $this->searchProvider; $advancedSearchProviders = $searchProvider ->getHasAdvancedFormSearchServices(); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php index 756438e71..8bb23886a 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php @@ -16,8 +16,9 @@ use Symfony\Component\DependencyInjection\Reference; class SearchableServicesCompilerPass implements CompilerPassInterface { - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process() */ public function process(ContainerBuilder $container) diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php index b8eebc3be..ad0957253 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php @@ -135,7 +135,7 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface $managerDefinition = $container->getDefinition(self::WIDGET_MANAGER); // collect the widget factories - /* @var $extensionClass HasWidgetFactoriesExtensionInterface */ + /** @var HasWidgetFactoriesExtensionInterface $extensionClass */ $extensionClass = $container->getExtension($extension); // throw an error if extension does not implement HasWidgetFactoriesExtensionInterface if (!$extensionClass instanceof HasWidgetFactoriesExtensionInterface) { @@ -182,7 +182,7 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface // register the widget with config to the service, using the method // `addWidget` if ($this->widgetServices[$alias] instanceof WidgetFactoryInterface) { - /* @var $factory WidgetFactoryInterface */ + /** @var WidgetFactoryInterface $factory */ $factory = $this->widgetServices[$alias]; // get the config (under the key which equals to widget_alias $config = isset($param[$factory->getWidgetAlias()]) ? @@ -263,7 +263,7 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface // add the services defined by factories foreach ($this->widgetFactories as $factory) { - /* @var $factory WidgetFactoryInterface */ + /** @var WidgetFactoryInterface $factory */ $alias = $factory->getWidgetAlias(); // check the alias is not empty diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 70ba2881f..d9562304f 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -285,7 +285,7 @@ class ExportManager ); } - /* @var $formatter FormatterInterface */ + /** @var FormatterInterface $formatter */ $formatter = $this->getFormatter($this->getFormatterAlias($data)); $filtersData = []; $aggregatorsData = []; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php index c1404d2b8..fb16d285f 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php @@ -216,9 +216,9 @@ class CSVFormatter implements FormatterInterface $columnKeysNb = count($this->getColumnHeaders()); $resultsKeysNb = count($this->export->getQueryKeys($this->exportData)); $results = $this->getOrderedResults(); - /* @var $columnHeaders string[] the column headers associations */ + /** @var string[] $columnHeaders the column headers associations */ $columnHeaders = []; - /* @var $data string[] the data of the csv file */ + /** @var string[] $data the data of the csv file */ $contentData = []; $content = []; @@ -253,7 +253,7 @@ class CSVFormatter implements FormatterInterface } // add the column headers - /* @var $columns string[] the column for this row */ + /** @var string[] $columns the column for this row */ $columns = array_slice($row, $rowKeysNb, $columnKeysNb); $columnPosition = $this->findColumnPosition($columnHeaders, $columns); diff --git a/src/Bundle/ChillMainBundle/Search/SearchProvider.php b/src/Bundle/ChillMainBundle/Search/SearchProvider.php index ccf013f2a..c6f350b20 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchProvider.php +++ b/src/Bundle/ChillMainBundle/Search/SearchProvider.php @@ -73,7 +73,7 @@ class SearchProvider throw new UnknowSearchNameException($name); } - /* + /** * return search services in an array, ordered by * the order key (defined in service definition) * the conflicts in keys (twice the same order) are resolved @@ -83,7 +83,6 @@ class SearchProvider * * @return SearchInterface[], with an int as array key */ - public function getByOrder() { //sort the array diff --git a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php index 1820d1775..ba4fd4687 100644 --- a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php @@ -20,21 +20,23 @@ use Twig\TwigFilter; */ class CSVCellTwig extends AbstractExtension { - /* - * Replace into a string the char " by "" + /** + * Replace into a string the char " by "". * - * @param String $content The input string. - * @return String The safe string. + * @param string $content The input string. + * + * @return string The safe string. */ public function csvCellFilter($content) { return str_replace('"', '""', $content); } - /* + /** * Returns a list of filters to add to the existing list. * * (non-PHPdoc) + * * @see Twig_Extension::getFilters() */ public function getFilters() @@ -48,7 +50,7 @@ class CSVCellTwig extends AbstractExtension ]; } - /* + /** * Returns the name of the extension. * * @return The name of the extension. diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php index 39be0150b..db80c0b35 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php @@ -30,10 +30,11 @@ class TranslatableStringTwig extends AbstractExtension $this->helper = $translatableStringHelper; } - /* + /** * Returns a list of filters to add to the existing list. * * (non-PHPdoc) + * * @see Twig_Extension::getFilters() */ public function getFilters() @@ -45,7 +46,7 @@ class TranslatableStringTwig extends AbstractExtension ), ]; } - /* + /** * Returns the name of the extension. * * @return The name of the extension. diff --git a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php index 8f181207c..05f219b4d 100644 --- a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php @@ -114,7 +114,7 @@ class WidgetRenderingTwig extends AbstractExtension $content = ''; foreach ($this->getWidgetsArraysOrdered($block) as $a) { - /* @var $widget Widget\WidgetInterface */ + /** @var Widget\WidgetInterface $widget */ $widget = $a[0]; $config = $a[1]; diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php index 72db44dac..643995757 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php @@ -325,7 +325,7 @@ abstract class AbstractExportTest extends WebTestCase */ public function testListExportPage() { - /* @var $client \Symfony\Component\BrowserKit\Client */ + /** @var \Symfony\Component\BrowserKit\Client $client */ $client = $this->getClient(); $export = $this->getExport(); $prophet = new \Prophecy\Prophet(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php index e3ac7337e..04adb3458 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php @@ -157,7 +157,7 @@ class UserControllerTest extends WebTestCase protected function isPasswordValid($username, $password) { - /* @var $passwordEncoder \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder */ + /** @var \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder $passwordEncoder */ $passwordEncoder = self::$container ->get(UserPasswordEncoderInterface::class); diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php index 3c8652fed..d3e9d7245 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php @@ -32,7 +32,7 @@ class UserCircleConsistencyValidator extends ConstraintValidator */ public function validate($value, Constraint $constraint) { - /* @var $user \Chill\MainBundle\Entity\User */ + /** @var \Chill\MainBundle\Entity\User $user */ $user = call_user_func([$value, $constraint->getUserFunction]); if (null === $user) { diff --git a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php index e0ba03194..6b4a60035 100644 --- a/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php @@ -693,7 +693,7 @@ final class ImportPeopleFromCSVCommand extends Command protected function matchColumnToCustomField($row) { $cfMappingsOptions = $this->input->getOption('custom-field'); - /* @var $em \Doctrine\Persistence\ObjectManager */ + /** @var \Doctrine\Persistence\ObjectManager $em */ $em = $this->em; foreach ($cfMappingsOptions as $cfMappingStringOption) { @@ -877,7 +877,7 @@ final class ImportPeopleFromCSVCommand extends Command $this->output->writeln($this->helper->localize($cf->getName())); // printing the possible answers - /* @var $table \Symfony\Component\Console\Helper\Table */ + /** @var \Symfony\Component\Console\Helper\Table $table */ $table = new Table($this->output); $table->setHeaders(['#', 'label', 'value']); $i = 0; @@ -954,7 +954,7 @@ final class ImportPeopleFromCSVCommand extends Command } // we skip if the opening date is now (or after yesterday) - /* @var $period \Chill\PersonBundle\Entity\AccompanyingPeriod */ + /** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $period */ $period = $person->getCurrentAccompanyingPeriod(); if ($period->getOpeningDate() > new DateTime('yesterday')) { @@ -1037,11 +1037,11 @@ final class ImportPeopleFromCSVCommand extends Command */ protected function processingCustomFields(Person $person, $row) { - /* @var $cfProvider \Chill\CustomFieldsBundle\Service\CustomFieldProvider */ + /** @var \Chill\CustomFieldsBundle\Service\CustomFieldProvider $cfProvider */ $cfProvider = $this->customFieldProvider; $cfData = []; - /* @var $$customField \Chill\CustomFieldsBundle\Entity\CustomField */ + /** @var \Chill\CustomFieldsBundle\Entity\CustomField $$customField */ foreach ($this->customFieldMapping as $rowNumber => $customField) { $builder = $this->formFactory->createBuilder(); $cfProvider->getCustomFieldByType($customField->getType()) @@ -1139,7 +1139,7 @@ final class ImportPeopleFromCSVCommand extends Command { $answers = []; - /* @var $choice \Symfony\Component\Form\ChoiceList\View\ChoiceView */ + /** @var \Symfony\Component\Form\ChoiceList\View\ChoiceView $choice */ foreach ($choices as $choice) { if ($choice instanceof \Symfony\Component\Form\ChoiceList\View\ChoiceView) { $answers[$choice->value] = $choice->label; diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index 55b18381e..7691fd363 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -318,7 +318,7 @@ class AccompanyingPeriodController extends AbstractController /** @var Person $person */ $person = $this->_getPerson($person_id); - /* @var $period AccompanyingPeriod */ + /** @var AccompanyingPeriod $period */ $period = array_filter( $person->getAccompanyingPeriods(), function (AccompanyingPeriod $p) use ($period_id) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 1c51e45c3..253a2b1d6 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -122,7 +122,7 @@ class LoadCustomFields extends AbstractFixture implements foreach ($personIds as $id) { // add info on 1 person on 2 if (rand(0, 1) === 1) { - /* @var $person Person */ + /** @var Person $person */ $person = $manager->getRepository(Person::class)->find($id); $person->setCFData([ 'remarques' => $this->createCustomFieldText() diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 8e0b5ac21..cdca01fdd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -411,7 +411,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface private function getLabelForCustomField($key, array $values, $data) { // for fields which are custom fields - /* @var $cf CustomField */ + /** @var CustomField $cf */ $cf = $this->entityManager ->getRepository(CustomField::class) ->findOneBy(['slug' => $this->DQLToSlug($key)]); diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 78a657f7b..2e0a69a75 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -166,8 +166,9 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf return self::NAME; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Chill\MainBundle\Search\SearchInterface::getOrder() */ public function getOrder() @@ -175,8 +176,9 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf return 100; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Chill\MainBundle\Search\SearchInterface::isActiveByDefault() */ public function isActiveByDefault() @@ -184,9 +186,14 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf return true; } - /* - * (non-PHPdoc) + /** + * (non-PHPdoc). + * * @see \Chill\MainBundle\Search\SearchInterface::renderResult() + * + * @param mixed $start + * @param mixed $limit + * @param mixed $format */ public function renderResult(array $terms, $start = 0, $limit = 50, array $options = [], $format = 'html') { diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php index e57f3f569..754d7d248 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php @@ -498,7 +498,7 @@ class AccompanyingPeriodControllerTest extends WebTestCase ]); $periods = $this->person->getAccompanyingPeriodsOrdered(); - /* @var $criteria Criteria */ + /** @var Criteria $criteria */ $criteria = Criteria::create(); //$criteria->where(Criteria::expr()->eq('openingDate', \DateTime::createFromFormat())) $firstPeriod = reset($periods); diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index b6e2d2756..601ffab83 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -509,7 +509,7 @@ class ReportList implements ListInterface, ExportElementValidatedInterface private function getLabelForCustomField($key, array $values, $data) { // for fields which are custom fields - /* @var $cf CustomField */ + /** @var CustomField $cf */ $cf = $this->em ->getRepository(CustomField::class) ->findOneBy(['slug' => $this->DQLToSlug($key)]); diff --git a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php index 09209d560..94cb94d29 100644 --- a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php @@ -29,7 +29,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface */ public $counter; - /* + /** * @var TokenStorageInterface */ public $tokenStorage; diff --git a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php index b45c013f0..6461c23e5 100644 --- a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php +++ b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php @@ -63,7 +63,7 @@ class CountNotificationTask implements NotificationCounterInterface public function resetCacheOnNewStates(Event $e) { - /* @var $task \Chill\TaskBundle\Entity\SingleTask */ + /** @var \Chill\TaskBundle\Entity\SingleTask $task */ $task = $e->getSubject(); if (null !== $task->getAssignee()) {