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

@@ -631,7 +631,7 @@ class AccompanyingPeriod implements
return $this->getOpenParticipations();
}
public function getGroupSequence()
public function getGroupSequence(): \Symfony\Component\Validator\Constraints\GroupSequence|array
{
if (self::STEP_DRAFT === $this->getStep()) {
return [[self::STEP_DRAFT]];
@@ -989,7 +989,7 @@ class AccompanyingPeriod implements
/**
* Validation functions.
*/
public function isDateConsistent(ExecutionContextInterface $context)
public function isDateConsistent(ExecutionContextInterface $context): void
{
if ($this->isOpen()) {
return;
@@ -1048,7 +1048,7 @@ class AccompanyingPeriod implements
/**
* Remove Participation.
*/
public function removeParticipation(AccompanyingPeriodParticipation $participation)
public function removeParticipation(AccompanyingPeriodParticipation $participation): void
{
$participation->setAccompanyingPeriod(null);
}

View File

@@ -140,7 +140,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
/**
* @return Collection<AccompanyingPeriodWorkEvaluationDocument>
*/
public function getDocuments()
public function getDocuments(): \Doctrine\Common\Collections\Collection
{
return $this->documents;
}

View File

@@ -84,7 +84,7 @@ class ClosingMotive
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -94,7 +94,7 @@ class ClosingMotive
*
* @return array
*/
public function getName()
public function getName(): array
{
return $this->name;
}
@@ -107,7 +107,7 @@ class ClosingMotive
/**
* @return ClosingMotive
*/
public function getParent()
public function getParent(): ?\Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive
{
return $this->parent;
}

View File

@@ -99,7 +99,7 @@ class AccompanyingPeriodParticipation
return $this;
}
private function checkSameStartEnd()
private function checkSameStartEnd(): void
{
if ($this->endDate === $this->startDate) {
$this->accompanyingPeriod->removeParticipation($this);

View File

@@ -530,7 +530,7 @@ class Household implements HasCentersInterface
}
}
public function removeAddress(Address $address)
public function removeAddress(Address $address): void
{
$this->addresses->removeElement($address);
}
@@ -572,7 +572,7 @@ class Household implements HasCentersInterface
* Used on household creation.
*/
#[Serializer\Groups(['create'])]
public function setForceAddress(Address $address)
public function setForceAddress(Address $address): void
{
$address->setValidFrom(new \DateTime('today'));
$this->addAddress($address);

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);
}

View File

@@ -88,9 +88,7 @@ class AbstractPersonResource implements TrackCreationInterface, TrackUpdateInter
return $this->personOwner;
}
/**
* @Groups({"read", "docgen:read"})
*/
#[Groups(['read', 'docgen:read'])]
public function getResourceKind(): string
{
if ($this->getPerson() instanceof Person) {
@@ -180,9 +178,7 @@ class AbstractPersonResource implements TrackCreationInterface, TrackUpdateInter
return $this;
}
/**
* @Assert\Callback
*/
#[Assert\Callback]
public function validate(ExecutionContextInterface $context, mixed $payload): void
{
if (null === $this->person && null === $this->thirdParty && (null === $this->freeText || '' === $this->freeText)) {

View File

@@ -42,7 +42,7 @@ class PersonAltName
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -52,7 +52,7 @@ class PersonAltName
*
* @return string
*/
public function getKey()
public function getKey(): string
{
return $this->key;
}
@@ -62,7 +62,7 @@ class PersonAltName
*
* @return string
*/
public function getLabel()
public function getLabel(): string
{
return $this->label;
}

View File

@@ -46,52 +46,52 @@ class PersonNotDuplicate
$this->date = new \DateTime();
}
public function getDate()
public function getDate(): \DateTime
{
return $this->date;
}
public function getId()
public function getId(): ?int
{
return $this->id;
}
public function getPerson1()
public function getPerson1(): ?\Chill\PersonBundle\Entity\Person
{
return $this->person1;
}
public function getPerson2()
public function getPerson2(): ?\Chill\PersonBundle\Entity\Person
{
return $this->person2;
}
public function getUser()
public function getUser(): ?\Chill\MainBundle\Entity\User
{
return $this->user;
}
public function setDate(\DateTime $date)
public function setDate(\DateTime $date): void
{
$this->date = $date;
}
public function setId(?int $id)
public function setId(?int $id): void
{
$this->id = $id;
}
public function setPerson1(Person $person1)
public function setPerson1(Person $person1): void
{
$this->person1 = $person1;
}
public function setPerson2(Person $person2)
public function setPerson2(Person $person2): void
{
$this->person2 = $person2;
}
public function setUser(User $user)
public function setUser(User $user): void
{
$this->user = $user;
}