apply rector rules

This commit is contained in:
2023-07-28 02:40:02 +02:00
parent 157cdf6dfc
commit f570fe92a5
112 changed files with 252 additions and 562 deletions

View File

@@ -33,12 +33,9 @@ class LoadReports extends AbstractFixture implements ContainerAwareInterface, Or
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* @var \Faker\Generator
*/
private $faker;
private readonly \Faker\Generator $faker;
public function __construct(private \Doctrine\ORM\EntityManager $entityManager)
public function __construct(private readonly \Doctrine\ORM\EntityManager $entityManager)
{
$this->faker = FakerFactory::create('fr_FR');
}

View File

@@ -31,17 +31,15 @@ use Doctrine\ORM\Mapping as ORM;
class Report implements HasCenterInterface, HasScopeInterface
{
/**
* @var array
* @ORM\Column(type="json")
*/
private $cFData;
private ?array $cFData = null;
/**
* @var CustomFieldsGroup
* @ORM\ManyToOne(
* targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldsGroup")
*/
private $cFGroup;
private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $cFGroup = null;
/**
* @var DateTime
@@ -59,22 +57,19 @@ class Report implements HasCenterInterface, HasScopeInterface
private $id;
/**
* @var Person
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private $person;
private ?\Chill\PersonBundle\Entity\Person $person = null;
/**
* @var Scope
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
*/
private $scope;
private ?\Chill\MainBundle\Entity\Scope $scope = null;
/**
* @var User
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private $user;
private ?\Chill\MainBundle\Entity\User $user = null;
/**
* @return Center

View File

@@ -31,10 +31,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
/**
* @var \Chill\MainBundle\Entity\User
*/
private $user;
private readonly \Chill\MainBundle\Entity\User $user;
public function __construct(
private readonly EntityManagerInterface $em,

View File

@@ -38,10 +38,7 @@ final class ReportControllerTest extends WebTestCase
*/
private static $client;
/**
* @var \Doctrine\ORM\EntityManagerInterface
*/
private static $em;
private static ?object $em = null;
/**
* @var CustomFieldsGroup

View File

@@ -27,15 +27,9 @@ use function count;
*/
final class TimelineProviderTest extends WebTestCase
{
/**
* @var \Doctrine\ORM\EntityManager
*/
private static $em;
private static ?object $em = null;
/**
* @var Person
*/
private $person;
private \Chill\PersonBundle\Entity\Person $person;
/**
* @var Report
@@ -158,18 +152,8 @@ final class TimelineProviderTest extends WebTestCase
->count(),
'the page contains a .report .summary element'
);
$this->assertContains(
'blah blah',
$crawler->filter('.report_entry .summary')
->text(),
'the page contains the text "blah blah"'
);
$this->assertContains(
'Propriétaire',
$crawler->filter('.report_entry .summary')
->text(),
'the page contains the mention "Propriétaire"'
);
$this->assertSelectorTextContains('.report_entry .summary', 'blah blah', 'the page contains the text "blah blah"');
$this->assertSelectorTextContains('.report_entry .summary', 'Propriétaire', 'the page contains the mention "Propriétaire"');
}
/**

View File

@@ -23,10 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
class Version20150622233319 extends AbstractMigration implements ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
private $container;
private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null;
public function down(Schema $schema): void
{