Upgrade code from 146 to new standards

This commit is contained in:
2023-10-16 18:04:40 +02:00
parent 8523f14214
commit 6b8d6b76ba
38 changed files with 56 additions and 62 deletions

View File

@@ -40,7 +40,7 @@ abstract class AddressPart extends FunctionNode
'country_id',
];
private \Doctrine\ORM\Query\AST\Node|string|null $date = null;
private null|\Doctrine\ORM\Query\AST\Node|string $date = null;
/**
* @var \Doctrine\ORM\Query\AST\Node

View File

@@ -977,7 +977,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"read"})
*/
public function getRequestor(): Person|ThirdParty|null
public function getRequestor(): null|Person|ThirdParty
{
return $this->requestorPerson ?? $this->requestorThirdParty;
}

View File

@@ -96,7 +96,7 @@ class Resource
/**
* @Groups({"read"})
*/
public function getResource(): \Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty|null
public function getResource(): null|\Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty
{
return $this->person ?? $this->thirdParty;
}

View File

@@ -619,7 +619,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @return true | array True if the accompanying periods are not collapsing,
* an array with data for displaying the error
*/
public function checkAccompanyingPeriodsAreNotCollapsing(): bool|array
public function checkAccompanyingPeriodsAreNotCollapsing(): array|bool
{
$periods = $this->getAccompanyingPeriodsOrdered();
$periodsNbr = count($periods);

View File

@@ -156,7 +156,7 @@ class SocialAction
*
* @return Collection|SocialAction[] a list with the elements of the given list which are parent of other elements in the given list
*/
public static function findAncestorSocialActions(\Doctrine\Common\Collections\Collection|array $socialActions): Collection
public static function findAncestorSocialActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
{
$ancestors = new ArrayCollection();
@@ -236,7 +236,7 @@ class SocialAction
/**
* @param Collection|SocialAction[] $socialActions
*/
public static function getDescendantsWithThisForActions(\Doctrine\Common\Collections\Collection|array $socialActions): Collection
public static function getDescendantsWithThisForActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
{
$unique = [];
@@ -420,7 +420,7 @@ class SocialAction
return $this;
}
public static function filterRemoveDeactivatedActions(ReadableCollection|array $actions, \DateTime $comparisonDate): ReadableCollection|array
public static function filterRemoveDeactivatedActions(array|ReadableCollection $actions, \DateTime $comparisonDate): array|ReadableCollection
{
$filterFn = fn (SocialAction $socialAction) => !$socialAction->isDesactivated($comparisonDate);

View File

@@ -110,7 +110,7 @@ class SocialIssue
*
* @return Collection|SocialIssue[]
*/
public static function findAncestorSocialIssues(\Doctrine\Common\Collections\Collection|array $socialIssues): Collection
public static function findAncestorSocialIssues(array|\Doctrine\Common\Collections\Collection $socialIssues): Collection
{
$ancestors = new ArrayCollection();

View File

@@ -41,7 +41,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): \Closure
{
return function (int|string|null $jobId) {
return function (null|int|string $jobId) {
if (null === $jobId || '' === $jobId) {
return '';
}

View File

@@ -42,7 +42,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa
public function getLabels($key, array $values, $data): \Closure
{
return function (int|string|null $scopeId) {
return function (null|int|string $scopeId) {
if (null === $scopeId || '' === $scopeId) {
return '';
}

View File

@@ -41,7 +41,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac
public function getLabels($key, array $values, $data): \Closure
{
return function (int|string|null $userId) {
return function (null|int|string $userId) {
if (null === $userId || '' === $userId) {
return '';
}

View File

@@ -46,7 +46,7 @@ final readonly class CenterAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): Closure
{
return function (int|string|null $value) {
return function (null|int|string $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -28,9 +28,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
{
public function __construct(private readonly EntityManagerInterface $entityManager) {}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -26,11 +26,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class ClosingMotiveType extends AbstractType
{
private TranslatorInterface $translator;
public function __construct(TranslatorInterface $translator)
public function __construct(private readonly TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -37,7 +37,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
*
* @throws ExceptionInterface
*/
public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null
public function normalize($object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string
{
$initial = $this->normalizer->normalize($object, $format, array_merge(
$context,

View File

@@ -518,7 +518,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase
/**
* @param array<Scope> $scopes
*/
private function buildPeriod(Person $person, array $scopes, User|null $creator, bool $confirm): AccompanyingPeriod
private function buildPeriod(Person $person, array $scopes, null|User $creator, bool $confirm): AccompanyingPeriod
{
$period = new AccompanyingPeriod();
$period->addPerson($person);

View File

@@ -349,7 +349,7 @@ Period closed!: Parcours clôturé!
Pediod closing form is not valide: Le formulaire de fermeture n'est pas valide
Consider canceled: Permet de considérer les parcours comme annulés
Canceled parcours help: Si coché, les parcours avec ce motif de cloture seront considérés comme annulés et ne seront pas pris en compte pour les statistiques. La modification se reflétera pour tous les motifs enfants
( Canceled period ): ( annulé )
( Canceled period ): (annulé)
#widget