mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Cherry-pick phpstan fixes after rector changes
This commit is contained in:
@@ -135,14 +135,14 @@ class AccompanyingPeriod implements
|
||||
private ?Location $administrativeLocation = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, Calendar>
|
||||
* @var ArrayCollection<int, Calendar>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Calendar::class, mappedBy: 'accompanyingPeriod')]
|
||||
private Collection&Selectable $calendars;
|
||||
#[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: Calendar::class)]
|
||||
private ArrayCollection $calendars;
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read'])]
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CLOSED])]
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'openingDate', groups: [AccompanyingPeriod::STEP_CLOSED], message: 'The closing date must be later than the date of creation')]
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'openingDate', message: 'The closing date must be later than the date of creation', groups: [AccompanyingPeriod::STEP_CLOSED])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTime $closingDate = null;
|
||||
|
||||
@@ -153,10 +153,10 @@ class AccompanyingPeriod implements
|
||||
private ?ClosingMotive $closingMotive = null;
|
||||
|
||||
/**
|
||||
* @var Collection<Comment>
|
||||
* @var Collection<(int|string), Comment>
|
||||
*/
|
||||
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_DRAFT])]
|
||||
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: Comment::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['createdAt' => Criteria::DESC, 'id' => 'DESC'])]
|
||||
private Collection $comments;
|
||||
|
||||
@@ -194,9 +194,9 @@ class AccompanyingPeriod implements
|
||||
private ?UserJob $job = null;
|
||||
|
||||
/**
|
||||
* @var Collection<AccompanyingPeriodLocationHistory>
|
||||
* @var Collection<int, AccompanyingPeriodLocationHistory>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodLocationHistory::class, mappedBy: 'period', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'period', targetEntity: AccompanyingPeriodLocationHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection $locationHistories;
|
||||
|
||||
#[Groups(['read', 'write', 'docgen:read'])]
|
||||
@@ -212,10 +212,10 @@ class AccompanyingPeriod implements
|
||||
private ?Origin $origin = null;
|
||||
|
||||
/**
|
||||
* @var Collection<AccompanyingPeriodParticipation>
|
||||
* @var Collection<int, AccompanyingPeriodParticipation>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'accompanyingPeriod', orphanRemoval: true, cascade: ['persist', 'refresh', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: AccompanyingPeriodParticipation::class, cascade: ['persist', 'refresh', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
#[ParticipationOverlap(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
private Collection $participations;
|
||||
|
||||
@@ -246,7 +246,7 @@ class AccompanyingPeriod implements
|
||||
private ?ThirdParty $requestorThirdParty = null;
|
||||
|
||||
/**
|
||||
* @var Collection<resource>
|
||||
* @var Collection<int, Resource>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
@@ -254,7 +254,7 @@ class AccompanyingPeriod implements
|
||||
private Collection $resources;
|
||||
|
||||
/**
|
||||
* @var Collection<Scope>
|
||||
* @var Collection<int, Scope>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must be associated to at least one scope')]
|
||||
@@ -263,7 +263,7 @@ class AccompanyingPeriod implements
|
||||
private Collection $scopes;
|
||||
|
||||
/**
|
||||
* @var Collection<SocialIssue>
|
||||
* @var Collection<int, SocialIssue>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must contains at least one social issue')]
|
||||
@@ -279,9 +279,9 @@ class AccompanyingPeriod implements
|
||||
private ?string $step = self::STEP_DRAFT;
|
||||
|
||||
/**
|
||||
* @var Collection<AccompanyingPeriodStepHistory>
|
||||
* @var Collection<int, AccompanyingPeriodStepHistory>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodStepHistory::class, mappedBy: 'period', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'period', targetEntity: AccompanyingPeriodStepHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection $stepHistories;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
|
||||
@@ -296,7 +296,7 @@ class AccompanyingPeriod implements
|
||||
private ?User $user = null;
|
||||
|
||||
/**
|
||||
* @var Collection<UserHistory>
|
||||
* @var Collection<int, UserHistory>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserHistory::class, mappedBy: 'accompanyingPeriod', orphanRemoval: true, cascade: ['persist', 'remove'])]
|
||||
private Collection $userHistories;
|
||||
@@ -311,10 +311,10 @@ class AccompanyingPeriod implements
|
||||
private ?User $userPrevious = null;
|
||||
|
||||
/**
|
||||
* @var Collection<AccompanyingPeriodWork>
|
||||
* @var Collection<int, AccompanyingPeriodWork>
|
||||
*/
|
||||
#[Assert\Valid(traverse: true)]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodWork::class, mappedBy: 'accompanyingPeriod')]
|
||||
#[ORM\OneToMany(mappedBy: 'accompanyingPeriod', targetEntity: AccompanyingPeriodWork::class)]
|
||||
private Collection $works;
|
||||
|
||||
/**
|
||||
@@ -801,7 +801,7 @@ class AccompanyingPeriod implements
|
||||
/**
|
||||
* Get a list of all persons which are participating to this course.
|
||||
*
|
||||
* @psalm-return Collection<(int|string), Person|null>
|
||||
* @psalm-return Collection<int, Person|null>
|
||||
*/
|
||||
public function getPersons(): Collection
|
||||
{
|
||||
|
@@ -21,6 +21,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Collections\ReadableCollection;
|
||||
use Doctrine\Common\Collections\Selectable;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
@@ -35,7 +36,7 @@ class Household implements HasCentersInterface
|
||||
/**
|
||||
* Addresses.
|
||||
*
|
||||
* @var Collection<Address>
|
||||
* @var Collection<int, \Chill\MainBundle\Entity\Address>
|
||||
*/
|
||||
#[Serializer\Groups(['write'])]
|
||||
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
@@ -47,33 +48,33 @@ class Household implements HasCentersInterface
|
||||
private CommentEmbeddable $commentMembers;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, HouseholdComposition>
|
||||
* @var ArrayCollection<int, HouseholdComposition>
|
||||
*/
|
||||
#[Assert\Valid(traverse: true, groups: ['household_composition'])]
|
||||
#[ORM\OneToMany(targetEntity: HouseholdComposition::class, mappedBy: 'household', orphanRemoval: true, cascade: ['persist'])]
|
||||
#[Assert\Valid(groups: ['household_composition'], traverse: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'household', targetEntity: HouseholdComposition::class, cascade: ['persist'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
|
||||
private Collection&Selectable $compositions;
|
||||
private ArrayCollection $compositions;
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\Column(type: Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var Collection<HouseholdMember>
|
||||
* @var Collection<int, HouseholdMember>
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: HouseholdMember::class, mappedBy: 'household')]
|
||||
#[ORM\OneToMany(mappedBy: 'household', targetEntity: HouseholdMember::class)]
|
||||
private Collection $members;
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, name: 'waiting_for_birth', options: ['default' => false])]
|
||||
#[ORM\Column(name: 'waiting_for_birth', type: Types::BOOLEAN, options: ['default' => false])]
|
||||
#[Assert\Type('boolean', groups: ['household_metadata'])]
|
||||
private bool $waitingForBirth = false;
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, name: 'waiting_for_birth_date', nullable: true, options: ['default' => null])]
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE, name: 'waiting_for_birth_date', nullable: true, options: ['default' => null])]
|
||||
#[Assert\Expression('this.getWaitingForBirth() == false or value != null', message: 'The waiting for birth date must be set', groups: ['household_metadata'])]
|
||||
private ?\DateTimeImmutable $waitingForBirthDate = null;
|
||||
|
||||
|
@@ -86,7 +86,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* The person's accompanying periods (when the person was accompanied by the center).
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodParticipation>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\AccompanyingPeriodParticipation>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
|
||||
@@ -95,7 +95,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* The accompanying period requested by the Person.
|
||||
*
|
||||
* @var Collection<AccompanyingPeriod>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\AccompanyingPeriod>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'requestorPerson')]
|
||||
private Collection $accompanyingPeriodRequested;
|
||||
@@ -103,7 +103,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* Addresses.
|
||||
*
|
||||
* @var Collection<Address>
|
||||
* @var Collection<int, \Chill\MainBundle\Entity\Address>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
|
||||
#[ORM\JoinTable(name: 'chill_person_persons_to_addresses')]
|
||||
@@ -111,7 +111,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
private Collection $addresses;
|
||||
|
||||
/**
|
||||
* @var Collection<PersonAltName>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\PersonAltName>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
private Collection $altNames;
|
||||
@@ -124,13 +124,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
private ?\DateTime $birthdate = null;
|
||||
|
||||
/**
|
||||
* @var Collection<Charge>
|
||||
* @var Collection<int, \Chill\BudgetBundle\Entity\Charge>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Charge::class, mappedBy: 'person')]
|
||||
private Collection $budgetCharges;
|
||||
|
||||
/**
|
||||
* @var Collection<resource>
|
||||
* @var Collection<int, \Chill\BudgetBundle\Entity\Resource>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Resource::class, mappedBy: 'person')]
|
||||
private Collection $budgetResources;
|
||||
@@ -149,14 +149,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
#[ORM\ManyToOne(targetEntity: Center::class)]
|
||||
private ?Center $center = null;
|
||||
|
||||
#[ORM\OneToOne(targetEntity: PersonCenterCurrent::class, mappedBy: 'person')]
|
||||
#[ORM\OneToOne(mappedBy: 'person', targetEntity: PersonCenterCurrent::class)]
|
||||
private ?PersonCenterCurrent $centerCurrent = null;
|
||||
|
||||
/**
|
||||
* @var Collection<PersonCenterHistory>
|
||||
* @var ArrayCollection<int, PersonCenterHistory>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: PersonCenterHistory::class, mappedBy: 'person', cascade: ['persist', 'remove'])]
|
||||
private Collection $centerHistory;
|
||||
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonCenterHistory::class, cascade: ['persist', 'remove'])]
|
||||
private ArrayCollection $centerHistory;
|
||||
|
||||
/**
|
||||
* Array where customfield's data are stored.
|
||||
@@ -256,13 +256,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* Read-only field, computed by the database.
|
||||
*
|
||||
* @var Collection<PersonHouseholdAddress>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\Household\PersonHouseholdAddress>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: PersonHouseholdAddress::class, mappedBy: 'person')]
|
||||
private Collection $householdAddresses;
|
||||
|
||||
/**
|
||||
* @var Collection<HouseholdMember>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\Household\HouseholdMember>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: HouseholdMember::class, mappedBy: 'person')]
|
||||
private Collection $householdParticipations;
|
||||
@@ -330,14 +330,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
private ?int $numberOfChildren = null;
|
||||
|
||||
/**
|
||||
* @var Collection<PersonPhone>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\PersonPhone>
|
||||
*/
|
||||
#[Assert\Valid(traverse: true)]
|
||||
#[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
|
||||
private Collection $otherPhoneNumbers;
|
||||
|
||||
/**
|
||||
* @var Collection<AccompanyingPeriod>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\AccompanyingPeriod>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'personLocation')]
|
||||
private Collection $periodLocatedOn;
|
||||
@@ -361,7 +361,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $proxyAccompanyingPeriodOpenState = false; // TO-DELETE ?
|
||||
/**
|
||||
* @var Collection<PersonResource>
|
||||
* @var Collection<int, \Chill\PersonBundle\Entity\Person\PersonResource>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: PersonResource::class, mappedBy: 'personOwner')]
|
||||
private Collection $resources;
|
||||
@@ -1633,7 +1633,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (\Doctrine\Common\Collections\Collection<int, Language>) $spokenLanguages
|
||||
* @param (Collection<int, Language>) $spokenLanguages
|
||||
*/
|
||||
public function setSpokenLanguages(Collection $spokenLanguages): self
|
||||
{
|
||||
|
Reference in New Issue
Block a user