cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:28:52 +01:00
parent 3631fd99fd
commit c8195e6df5
65 changed files with 155 additions and 139 deletions

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