DX: rector rules upt to PHP 74

This commit is contained in:
2023-04-15 00:20:19 +02:00
parent a68190f0c6
commit 858ade467c
213 changed files with 433 additions and 1052 deletions

View File

@@ -69,9 +69,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
private function getCenters(): Iterator
{
$references = array_map(
static function ($a) {
return $a['ref'];
},
static fn($a) => $a['ref'],
LoadCenters::$centers
);
$number = random_int(1, count($references));

View File

@@ -189,7 +189,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
* @ORM\JoinColumn(name="created_by", referencedColumnName="id")
*/
private ?User $createdBy;
private ?User $createdBy = null;
/**
* @ORM\Column(name="email", type="string", length=255, nullable=true)
@@ -272,13 +272,13 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Column(name="updated_at", type="datetime_immutable", nullable=true)
*/
private ?DateTimeImmutable $updatedAt;
private ?DateTimeImmutable $updatedAt = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
* @ORM\JoinColumn(name="updated_by", referencedColumnName="id")
*/
private ?User $updatedBy;
private ?User $updatedBy = null;
/**
* ThirdParty constructor.

View File

@@ -103,15 +103,11 @@ class PickThirdPartyType extends AbstractType
$resolver
->setDefault('class', ThirdParty::class)
->setDefault('choice_label', static function (ThirdParty $tp) {
return $tp->getName();
})
->setDefault('choice_loader', function (Options $options) {
return new ThirdPartyChoiceLoader(
$options['center'],
$this->em->getRepository(ThirdParty::class)
);
});
->setDefault('choice_label', static fn(ThirdParty $tp) => $tp->getName())
->setDefault('choice_loader', fn(Options $options) => new ThirdPartyChoiceLoader(
$options['center'],
$this->em->getRepository(ThirdParty::class)
));
}
public function getParent(): string

View File

@@ -77,9 +77,7 @@ class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractTyp
return self::PREFIX_TYPE . $item;
},
'choice_value' => function ($item) {
return $this->reverseTransform($item);
},
'choice_value' => fn($item) => $this->reverseTransform($item),
]);
}