Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -55,8 +55,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
*/
#[DiscriminatorMap(typeProperty: 'type', mapping: ['person' => Person::class])]
#[ORM\Entity]
#[ORM\Index(name: 'person_names', columns: ['firstName', 'lastName'])] // ,
#[ORM\Index(name: 'person_birthdate', columns: ['birthdate'])] // @ORM\HasLifecycleCallbacks
#[ORM\Index(columns: ['firstName', 'lastName'], name: 'person_names')] // ,
#[ORM\Index(columns: ['birthdate'], name: 'person_birthdate')] // @ORM\HasLifecycleCallbacks
#[ORM\Table(name: 'chill_person_person')]
#[ORM\HasLifecycleCallbacks]
#[PersonHasCenter]
@@ -85,7 +85,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @var Collection<int, AccompanyingPeriodParticipation>
*/
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\OneToMany(mappedBy: 'person', targetEntity: AccompanyingPeriodParticipation::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
private Collection $accompanyingPeriodParticipations;
@@ -94,7 +94,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @var Collection<int, AccompanyingPeriod>
*/
#[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'requestorPerson')]
#[ORM\OneToMany(mappedBy: 'requestorPerson', targetEntity: AccompanyingPeriod::class)]
private Collection $accompanyingPeriodRequested;
/**
@@ -110,7 +110,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @var Collection<int, PersonAltName>
*/
#[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonAltName::class, cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
private Collection $altNames;
/**
@@ -123,13 +123,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @var Collection<int, Charge>
*/
#[ORM\OneToMany(targetEntity: Charge::class, mappedBy: 'person')]
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Charge::class)]
private Collection $budgetCharges;
/**
* @var Collection<int, \Chill\BudgetBundle\Entity\Resource>
*/
#[ORM\OneToMany(targetEntity: Resource::class, mappedBy: 'person')]
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Resource::class)]
private Collection $budgetResources;
/**
@@ -1144,7 +1144,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception
*/
public function getLastAddress(?\DateTime $from = null)
public function getLastAddress(?\DateTime $from = null): ?\Chill\MainBundle\Entity\Address
{
return $this->getCurrentHouseholdAddress(
null !== $from ? \DateTimeImmutable::createFromMutable($from) : null
@@ -1257,7 +1257,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @return Collection<Language>
*/
public function getSpokenLanguages()
public function getSpokenLanguages(): \Doctrine\Common\Collections\Collection
{
return $this->spokenLanguages;
}
@@ -1303,7 +1303,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* This method add violation errors.
*/
#[Assert\Callback(groups: ['accompanying_period_consistent'])]
public function isAccompanyingPeriodValid(ExecutionContextInterface $context)
public function isAccompanyingPeriodValid(ExecutionContextInterface $context): void
{
$r = $this->checkAccompanyingPeriodsAreNotCollapsing();
@@ -1329,7 +1329,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* This method add violation errors.
*/
#[Assert\Callback(groups: ['addresses_consistent'])]
public function isAddressesValid(ExecutionContextInterface $context)
public function isAddressesValid(ExecutionContextInterface $context): void
{
if ($this->hasTwoAdressWithSameValidFromDate()) {
$context
@@ -1387,7 +1387,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
}
}
public function removeAddress(Address $address)
public function removeAddress(Address $address): void
{
$this->addresses->removeElement($address);
}