DX: apply rector rulesset up to PHP72

This commit is contained in:
2023-03-29 22:32:52 +02:00
parent 64b8ae3df1
commit b9a7530f7a
110 changed files with 194 additions and 229 deletions

View File

@@ -64,7 +64,7 @@ final class ReportControllerNextTest extends WebTestCase
$customFieldsGroups = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']);
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
//filter customFieldsGroup to get only "situation de logement"
$filteredCustomFieldsGroupHouse = array_filter(
$customFieldsGroups,

View File

@@ -82,7 +82,7 @@ final class ReportControllerTest extends WebTestCase
$customFieldsGroups = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->findBy(['entity' => 'Chill\ReportBundle\Entity\Report']);
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
//filter customFieldsGroup to get only "situation de logement"
$filteredCustomFieldsGroupHouse = array_filter(
$customFieldsGroups,
@@ -132,7 +132,7 @@ final class ReportControllerTest extends WebTestCase
$form = $crawlerAddAReportPage->selectButton('Créer un nouveau rapport')->form();
$this->assertInstanceOf(
'Symfony\Component\DomCrawler\Form',
\Symfony\Component\DomCrawler\Form::class,
$form,
'I can see a form with a button "add a new report" '
);
@@ -251,7 +251,7 @@ final class ReportControllerTest extends WebTestCase
$link = $crawlerPersonPage->selectLink("AJOUT D'UN RAPPORT")->link();
$this->assertInstanceOf(
'Symfony\Component\DomCrawler\Link',
\Symfony\Component\DomCrawler\Link::class,
$link,
'There is a "add a report" link in menu'
);
@@ -278,7 +278,7 @@ final class ReportControllerTest extends WebTestCase
->form();
$this->assertInstanceOf(
'Symfony\Component\DomCrawler\Form',
\Symfony\Component\DomCrawler\Form::class,
$addForm,
'I have a report form'
);

View File

@@ -32,7 +32,7 @@ final class ChillReportExtensionTest extends KernelTestCase
$reportFounded = false;
foreach ($customizablesEntities as $customizablesEntity) {
if ('Chill\ReportBundle\Entity\Report' === $customizablesEntity['class']) {
if (\Chill\ReportBundle\Entity\Report::class === $customizablesEntity['class']) {
$reportFounded = true;
}
}

View File

@@ -167,7 +167,7 @@ final class ReportVoterTest extends KernelTestCase
{
$token = $this->prophet->prophesize();
$token
->willImplement('\Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
->willImplement('\\' . \Symfony\Component\Security\Core\Authentication\Token\TokenInterface::class);
if (null === $user) {
$token->getUser()->willReturn(null);

View File

@@ -191,6 +191,6 @@ final class TimelineProviderTest extends WebTestCase
}
}
return $groups[mt_rand(0, count($groups) - 1)];
return $groups[random_int(0, count($groups) - 1)];
}
}