cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera 2021-11-30 11:28:52 +01:00
parent 3631fd99fd
commit c8195e6df5
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
65 changed files with 155 additions and 139 deletions

View File

@ -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,

View File

@ -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');

View File

@ -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
*/

View File

@ -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)

View File

@ -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';

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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']) {

View File

@ -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)) {

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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(

View File

@ -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();

View File

@ -28,7 +28,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
*/
public $counter;
/*
/**
* @var TokenStorageInterface
*/
public $tokenStorage;

View File

@ -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);

View File

@ -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)

View File

@ -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)) {

View File

@ -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) {

View File

@ -28,7 +28,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
*/
public $counter;
/*
/**
* @var TokenStorageInterface
*/
public $tokenStorage;

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)) {

View File

@ -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(

View File

@ -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(); }

View File

@ -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);

View File

@ -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)

View File

@ -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
{

View File

@ -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)) {

View File

@ -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() .

View File

@ -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;

View File

@ -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)

View File

@ -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)) {

View File

@ -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 {

View File

@ -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)

View File

@ -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)

View File

@ -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');

View File

@ -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')

View File

@ -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;
}

View File

@ -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();

View File

@ -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)

View File

@ -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

View File

@ -285,7 +285,7 @@ class ExportManager
);
}
/* @var $formatter FormatterInterface */
/** @var FormatterInterface $formatter */
$formatter = $this->getFormatter($this->getFormatterAlias($data));
$filtersData = [];
$aggregatorsData = [];

View File

@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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];

View File

@ -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();

View File

@ -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);

View File

@ -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) {

View File

@ -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;

View File

@ -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) {

View File

@ -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()

View File

@ -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)]);

View File

@ -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')
{

View File

@ -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);

View File

@ -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)]);

View File

@ -29,7 +29,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
*/
public $counter;
/*
/**
* @var TokenStorageInterface
*/
public $tokenStorage;

View File

@ -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()) {