upgrade php-cs-fixer to 3.47.0

This commit is contained in:
2024-01-22 12:14:39 +01:00
parent fdfc3fb7ec
commit 27ce322690
58 changed files with 114 additions and 113 deletions

View File

@@ -25,9 +25,9 @@ use Doctrine\Persistence\ObjectManager;
class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterface
{
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfText = null;
private ?CustomField $cfText = null;
private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfChoice = null;
private ?CustomField $cfChoice = null;
/**
* /**

View File

@@ -147,7 +147,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class,
'class' => AccompanyingPeriod\ClosingMotive::class,
'name' => 'closing_motive',
'base_path' => '/admin/person/closing-motive',
'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class,
@@ -168,7 +168,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'class' => AccompanyingPeriod\Origin::class,
'name' => 'origin',
'base_path' => '/admin/person/origin',
'form_class' => \Chill\PersonBundle\Form\OriginType::class,
@@ -535,7 +535,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class,
'class' => AccompanyingPeriod\Comment::class,
'name' => 'accompanying_period_comment',
'base_path' => '/api/1.0/person/accompanying-period/comment',
'base_role' => 'ROLE_USER',
@@ -554,7 +554,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class,
'class' => AccompanyingPeriod\Resource::class,
'name' => 'accompanying_period_resource',
'base_path' => '/api/1.0/person/accompanying-period/resource',
'base_role' => 'ROLE_USER',
@@ -573,7 +573,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'class' => AccompanyingPeriod\Origin::class,
'name' => 'accompanying_period_origin',
'base_path' => '/api/1.0/person/accompanying-period/origin',
'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class,
@@ -718,7 +718,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork::class,
'class' => AccompanyingPeriod\AccompanyingPeriodWork::class,
'name' => 'accompanying_period_work',
'base_path' => '/api/1.0/person/accompanying-course/work',
'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseWorkApiController::class,

View File

@@ -91,14 +91,14 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface
return $this->startDate;
}
public function setAddressLocation(?Address $addressLocation): AccompanyingPeriodLocationHistory
public function setAddressLocation(?Address $addressLocation): AccompanyingPeriod\AccompanyingPeriodLocationHistory
{
$this->addressLocation = $addressLocation;
return $this;
}
public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriodLocationHistory
public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriod\AccompanyingPeriodLocationHistory
{
$this->endDate = $endDate;
@@ -108,21 +108,21 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface
/**
* @internal use AccompanyingPeriod::addLocationHistory
*/
public function setPeriod(AccompanyingPeriod $period): AccompanyingPeriodLocationHistory
public function setPeriod(AccompanyingPeriod $period): AccompanyingPeriod\AccompanyingPeriodLocationHistory
{
$this->period = $period;
return $this;
}
public function setPersonLocation(?Person $personLocation): AccompanyingPeriodLocationHistory
public function setPersonLocation(?Person $personLocation): AccompanyingPeriod\AccompanyingPeriodLocationHistory
{
$this->personLocation = $personLocation;
return $this;
}
public function setStartDate(?\DateTimeImmutable $startDate): AccompanyingPeriodLocationHistory
public function setStartDate(?\DateTimeImmutable $startDate): AccompanyingPeriod\AccompanyingPeriodLocationHistory
{
$this->startDate = $startDate;

View File

@@ -108,7 +108,7 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
return $this;
}
public function setStep(string $step): AccompanyingPeriodStepHistory
public function setStep(string $step): AccompanyingPeriod\AccompanyingPeriodStepHistory
{
$this->step = $step;

View File

@@ -255,7 +255,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
$this->referrersHistory = new ArrayCollection();
}
public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self
public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriod\AccompanyingPeriodWorkEvaluation $evaluation): self
{
if (!$this->accompanyingPeriodWorkEvaluations->contains($evaluation)) {
$this->accompanyingPeriodWorkEvaluations[] = $evaluation;
@@ -265,7 +265,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
return $this;
}
public function addGoal(AccompanyingPeriodWorkGoal $goal): self
public function addGoal(AccompanyingPeriod\AccompanyingPeriodWorkGoal $goal): self
{
if (!$this->goals->contains($goal)) {
$this->goals[] = $goal;
@@ -288,7 +288,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
{
if (!$this->getReferrers()->contains($referrer)) {
$this->referrersHistory[] =
new AccompanyingPeriodWorkReferrerHistory($this, $referrer, new \DateTimeImmutable('today'));
new AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory($this, $referrer, new \DateTimeImmutable('today'));
}
return $this;
@@ -393,8 +393,8 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
public function getReferrers(): ReadableCollection
{
$users = $this->referrersHistory
->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate())
->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser())
->filter(fn (AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate())
->map(fn (AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser())
->getValues()
;
@@ -452,7 +452,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
return $this->updatedBy;
}
public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self
public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriod\AccompanyingPeriodWorkEvaluation $evaluation): self
{
$this->accompanyingPeriodWorkEvaluations
->removeElement($evaluation);
@@ -461,7 +461,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
return $this;
}
public function removeGoal(AccompanyingPeriodWorkGoal $goal): self
public function removeGoal(AccompanyingPeriod\AccompanyingPeriodWorkGoal $goal): self
{
if ($this->goals->removeElement($goal)) {
// set the owning side to null (unless already changed)

View File

@@ -35,7 +35,7 @@ class AccompanyingPeriodWorkGoal
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="goals")
*/
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork $accompanyingPeriodWork = null;
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
/**
* @ORM\ManyToOne(targetEntity=Goal::class)

View File

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

View File

@@ -86,7 +86,7 @@ class UserHistory implements TrackCreationInterface
return $this->user;
}
public function setEndDate(?\DateTimeImmutable $endDate): UserHistory
public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriod\UserHistory
{
$this->endDate = $endDate;

View File

@@ -52,7 +52,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\MainBundle\Entity\Address $address = null;
private ?Address $address = null;
/**
* @ORM\Id
@@ -61,7 +61,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\Household\Household $household = null;
private ?Household $household = null;
/**
* @ORM\Id
@@ -70,7 +70,7 @@ class PersonHouseholdAddress
*
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* @ORM\Column(type="date_immutable")

View File

@@ -227,7 +227,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Civility $civility = null;
private ?Civility $civility = null;
/**
* Contact information for contacting the person.
@@ -245,7 +245,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Country $countryOfBirth = null;
private ?Country $countryOfBirth = null;
/**
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
@@ -257,7 +257,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\User $createdBy = null;
private ?User $createdBy = null;
/**
* Cache the computation of household.
@@ -390,7 +390,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\PersonBundle\Entity\MaritalStatus $maritalStatus = null;
private ?MaritalStatus $maritalStatus = null;
/**
* Comment on marital status.
@@ -433,7 +433,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\JoinColumn(nullable=true)
*/
private ?\Chill\MainBundle\Entity\Country $nationality = null;
private ?Country $nationality = null;
/**
* Number of children.
@@ -525,7 +525,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* targetEntity=User::class
* )
*/
private ?\Chill\MainBundle\Entity\User $updatedBy = null;
private ?User $updatedBy = null;
/**
* Person constructor.
@@ -1356,7 +1356,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @return PersonResource[]|Collection
*/
public function getResources(): array|\Doctrine\Common\Collections\Collection
public function getResources(): array|Collection
{
return $this->resources;
}

View File

@@ -63,7 +63,7 @@ class PersonCenterCurrent
*
* @internal Should not be instantied, unless inside Person entity
*/
public function __construct(PersonCenterHistory $history)
public function __construct(Person\PersonCenterHistory $history)
{
$this->person = $history->getPerson();
$this->center = $history->getCenter();

View File

@@ -71,7 +71,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
*
* @Groups({"read", "docgen:read"})
*/
private ?PersonResourceKind $kind = null;
private ?Person\PersonResourceKind $kind = null;
/**
* The person which host the owner of this resource.
@@ -127,7 +127,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
return $this->id;
}
public function getKind(): ?PersonResourceKind
public function getKind(): ?Person\PersonResourceKind
{
return $this->kind;
}
@@ -196,7 +196,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function setKind(?PersonResourceKind $kind): self
public function setKind(?Person\PersonResourceKind $kind): self
{
$this->kind = $kind;

View File

@@ -52,7 +52,7 @@ class PersonAltName
* inversedBy="altNames"
* )
*/
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* Get id.

View File

@@ -43,17 +43,17 @@ class PersonNotDuplicate
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?\Chill\PersonBundle\Entity\Person $person1 = null;
private ?Person $person1 = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?\Chill\PersonBundle\Entity\Person $person2 = null;
private ?Person $person2 = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private ?\Chill\MainBundle\Entity\User $user = null;
private ?User $user = null;
public function __construct()
{

View File

@@ -79,7 +79,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="socialActions")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $issue = null;
private ?SocialIssue $issue = null;
/**
* @ORM\Column(type="float", name="ordering", options={"default": 0.0})
@@ -89,7 +89,7 @@ class SocialAction
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class, inversedBy="children")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialAction $parent = null;
private ?SocialAction $parent = null;
/**
* @var Collection<Result>
@@ -166,7 +166,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(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
public static function findAncestorSocialActions(array|Collection $socialActions): Collection
{
$ancestors = new ArrayCollection();
@@ -246,7 +246,7 @@ class SocialAction
/**
* @param Collection|SocialAction[] $socialActions
*/
public static function getDescendantsWithThisForActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection
public static function getDescendantsWithThisForActions(array|Collection $socialActions): Collection
{
$unique = [];

View File

@@ -57,7 +57,7 @@ class SocialIssue
/**
* @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="children")
*/
private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $parent = null;
private ?SocialIssue $parent = null;
/**
* @var Collection<SocialAction>
@@ -115,7 +115,7 @@ class SocialIssue
*
* @return Collection|SocialIssue[]
*/
public static function findAncestorSocialIssues(array|\Doctrine\Common\Collections\Collection $socialIssues): Collection
public static function findAncestorSocialIssues(array|Collection $socialIssues): Collection
{
$ancestors = new ArrayCollection();

View File

@@ -16,7 +16,6 @@ use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\UserJobRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
@@ -59,7 +58,7 @@ class CreatorJobAggregator implements AggregatorInterface
->leftJoin(
UserJobHistory::class,
"{$p}_jobHistory",
Expr\Join::WITH,
Join::WITH,
$qb->expr()->andX(
$qb->expr()->eq("{$p}_jobHistory.user", "{$p}_userHistory.createdBy"), // et si il est null ?
$qb->expr()->andX(

View File

@@ -110,6 +110,8 @@ final readonly class ListAccompanyingPeriodHelper
return $this->translatableStringHelper->localize(json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR));
},
'acpCreatedBy', 'acpUpdatedBy', 'referrer' => $this->userHelper->getLabel($key, $values, 'export.list.acp.'.$key),
'acpParticipantsPersons' => function ($value) {
},
'locationPersonName', 'requestorPerson' => function ($value) use ($key) {
if ('_header' === $value) {
return 'export.list.acp.'.$key;

View File

@@ -34,7 +34,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
private ?object $em = null;
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* @var string The url using for seeing the person's information

View File

@@ -23,7 +23,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase
{
private ?object $em = null;
private ?\Chill\PersonBundle\Entity\Person $person = null;
private ?Person $person = null;
/**
* @var string The url to view the person details

View File

@@ -33,7 +33,7 @@ final class CountAccompanyingPeriodWorkAssociatePersonOnWorkTest extends Abstrac
$em = self::$container->get(EntityManagerInterface::class);
yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(true));
yield new CountAccompanyingPeriodWorkAssociatePersonOnwork($em, $this->getParameters(false));
yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(false));
}
public function getFormData(): array