upgrade php-cs 3.49

This commit is contained in:
2024-02-07 10:43:53 +01:00
parent 51ebc253aa
commit 036fe8d6f8
257 changed files with 605 additions and 605 deletions

View File

@@ -39,7 +39,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
return 'accompanying-period-step-change';
}
public function run(array $lastExecutionData): null|array
public function run(array $lastExecutionData): array|null
{
($this->requestor)();

View File

@@ -33,7 +33,7 @@ class AccompanyingPeriodStepChanger
) {
}
public function __invoke(AccompanyingPeriod $period, string $transition, string $workflowName = null): void
public function __invoke(AccompanyingPeriod $period, string $transition, ?string $workflowName = null): void
{
$workflow = $this->workflowRegistry->get($period, $workflowName);

View File

@@ -143,7 +143,7 @@ class ReassignAccompanyingPeriodController extends AbstractController
return $builder->getForm();
}
private function buildReassignForm(array $periodIds, User $userFrom = null): FormInterface
private function buildReassignForm(array $periodIds, ?User $userFrom = null): FormInterface
{
$defaultData = [
'userFrom' => $userFrom,

View File

@@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
class SocialIssueController extends CRUDController
{
protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
{
if ('new' === $action) {
return parent::createFormFor($action, $entity, $formClass, ['step' => 'create']);

View File

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

View File

@@ -479,7 +479,7 @@ class AccompanyingPeriod implements
*
* @uses AccompanyingPeriod::setClosingDate()
*/
public function __construct(\DateTime $dateOpening = null)
public function __construct(?\DateTime $dateOpening = null)
{
$this->calendars = new ArrayCollection(); // TODO we cannot add a dependency between AccompanyingPeriod and calendars
$this->participations = new ArrayCollection();
@@ -575,7 +575,7 @@ class AccompanyingPeriod implements
return $this;
}
public function addPerson(Person $person = null): self
public function addPerson(?Person $person = null): self
{
if (null !== $person) {
$this->createParticipationFor($person);
@@ -829,7 +829,7 @@ class AccompanyingPeriod implements
*
* @Groups({"read"})
*/
public function getLocation(\DateTimeImmutable $at = null): ?Address
public function getLocation(?\DateTimeImmutable $at = null): ?Address
{
if ($this->getPersonLocation() instanceof Person) {
return $this->getPersonLocation()->getCurrentPersonAddress();
@@ -1029,7 +1029,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"read"})
*/
public function getRequestor(): null|Person|ThirdParty
public function getRequestor(): Person|ThirdParty|null
{
return $this->requestorPerson ?? $this->requestorThirdParty;
}
@@ -1257,7 +1257,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setAddressLocation(Address $addressLocation = null): self
public function setAddressLocation(?Address $addressLocation = null): self
{
if ($this->addressLocation !== $addressLocation) {
$this->addressLocation = $addressLocation;
@@ -1297,7 +1297,7 @@ class AccompanyingPeriod implements
return $this;
}
public function setClosingMotive(ClosingMotive $closingMotive = null): self
public function setClosingMotive(?ClosingMotive $closingMotive = null): self
{
$this->closingMotive = $closingMotive;
@@ -1372,7 +1372,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setPersonLocation(Person $person = null): self
public function setPersonLocation(?Person $person = null): self
{
if ($this->personLocation !== $person) {
$this->personLocation = $person;
@@ -1394,7 +1394,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setPinnedComment(Comment $comment = null): self
public function setPinnedComment(?Comment $comment = null): self
{
if (null !== $this->pinnedComment) {
$this->addComment($this->pinnedComment);
@@ -1405,7 +1405,7 @@ class AccompanyingPeriod implements
return $this;
}
public function setRemark(string $remark = null): self
public function setRemark(?string $remark = null): self
{
$this->remark = (string) $remark;
@@ -1566,14 +1566,14 @@ class AccompanyingPeriod implements
} while ($steps->valid());
}
private function setRequestorPerson(Person $requestorPerson = null): self
private function setRequestorPerson(?Person $requestorPerson = null): self
{
$this->requestorPerson = $requestorPerson;
return $this;
}
private function setRequestorThirdParty(ThirdParty $requestorThirdParty = null): self
private function setRequestorThirdParty(?ThirdParty $requestorThirdParty = null): self
{
$this->requestorThirdParty = $requestorThirdParty;

View File

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

View File

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

View File

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

View File

@@ -107,7 +107,7 @@ class Resource
/**
* @Groups({"read"})
*/
public function getResource(): null|Person|ThirdParty
public function getResource(): Person|ThirdParty|null
{
return $this->person ?? $this->thirdParty;
}
@@ -124,7 +124,7 @@ class Resource
return $this;
}
public function setComment(string $comment = null): self
public function setComment(?string $comment = null): self
{
$this->comment = (string) $comment;

View File

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

View File

@@ -18,5 +18,5 @@ interface HasPerson
{
public function getPerson(): ?Person;
public function setPerson(Person $person = null): HasPerson;
public function setPerson(?Person $person = null): HasPerson;
}

View File

@@ -214,7 +214,7 @@ class Household
*
* @Serializer\SerializedName("current_address")
*/
public function getCurrentAddress(\DateTime $at = null): ?Address
public function getCurrentAddress(?\DateTime $at = null): ?Address
{
$at ??= new \DateTime('today');
@@ -234,7 +234,7 @@ class Household
*
* @Serializer\SerializedName("current_composition")
*/
public function getCurrentComposition(\DateTimeImmutable $at = null): ?HouseholdComposition
public function getCurrentComposition(?\DateTimeImmutable $at = null): ?HouseholdComposition
{
$at ??= new \DateTimeImmutable('today');
$criteria = new Criteria();
@@ -262,12 +262,12 @@ class Household
/**
* @Serializer\Groups({"docgen:read"})
*/
public function getCurrentMembers(\DateTimeImmutable $now = null): Collection
public function getCurrentMembers(?\DateTimeImmutable $now = null): Collection
{
return $this->getMembers()->matching($this->buildCriteriaCurrentMembers($now));
}
public function getCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null)
public function getCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -286,7 +286,7 @@ class Household
*
* @Serializer\SerializedName("current_members_id")
*/
public function getCurrentMembersIds(\DateTimeImmutable $now = null): ReadableCollection
public function getCurrentMembersIds(?\DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)->map(
static fn (HouseholdMember $m) => $m->getId()
@@ -296,7 +296,7 @@ class Household
/**
* @return HouseholdMember[]
*/
public function getCurrentMembersOrdered(\DateTimeImmutable $now = null): Collection
public function getCurrentMembersOrdered(?\DateTimeImmutable $now = null): Collection
{
$members = $this->getCurrentMembers($now);
@@ -338,7 +338,7 @@ class Household
return $members;
}
public function getCurrentMembersWithoutPosition(\DateTimeInterface $now = null)
public function getCurrentMembersWithoutPosition(?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -355,7 +355,7 @@ class Household
*
* @return ReadableCollection<(int|string), Person>
*/
public function getCurrentPersons(\DateTimeImmutable $now = null): ReadableCollection
public function getCurrentPersons(?\DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)
->map(static fn (HouseholdMember $m) => $m->getPerson());
@@ -424,7 +424,7 @@ class Household
});
}
public function getNonCurrentMembers(\DateTimeImmutable $now = null): Collection
public function getNonCurrentMembers(?\DateTimeImmutable $now = null): Collection
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -444,7 +444,7 @@ class Household
return $this->getMembers()->matching($criteria);
}
public function getNonCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null)
public function getNonCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -454,7 +454,7 @@ class Household
return $this->getNonCurrentMembers($now)->matching($criteria);
}
public function getNonCurrentMembersWithoutPosition(\DateTimeInterface $now = null)
public function getNonCurrentMembersWithoutPosition(?\DateTimeInterface $now = null)
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -644,7 +644,7 @@ class Household
}
}
private function buildCriteriaCurrentMembers(\DateTimeImmutable $now = null): Criteria
private function buildCriteriaCurrentMembers(?\DateTimeImmutable $now = null): Criteria
{
$criteria = new Criteria();
$expr = Criteria::expr();

View File

@@ -153,7 +153,7 @@ class HouseholdMember
return $this->startDate;
}
public function isCurrent(\DateTimeImmutable $at = null): bool
public function isCurrent(?\DateTimeImmutable $at = null): bool
{
$at ??= new \DateTimeImmutable('now');
@@ -174,7 +174,7 @@ class HouseholdMember
return $this;
}
public function setEndDate(\DateTimeImmutable $endDate = null): self
public function setEndDate(?\DateTimeImmutable $endDate = null): self
{
$this->endDate = $endDate;

View File

@@ -671,7 +671,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception if two lines of the accompanying period are open
*/
public function close(AccompanyingPeriod $accompanyingPeriod = null): void
public function close(?AccompanyingPeriod $accompanyingPeriod = null): void
{
$this->proxyAccompanyingPeriodOpenState = false;
}
@@ -854,7 +854,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception
*/
public function getAddressAt(\DateTimeInterface $at = null): ?Address
public function getAddressAt(?\DateTimeInterface $at = null): ?Address
{
$at ??= new \DateTime('now');
@@ -1035,7 +1035,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $currentAccompanyingPeriods;
}
public function getCurrentHousehold(\DateTimeImmutable $at = null): ?Household
public function getCurrentHousehold(?\DateTimeImmutable $at = null): ?Household
{
$participation = $this->getCurrentHouseholdParticipationShareHousehold($at);
@@ -1050,7 +1050,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* if the given date is 'now', use instead @see{getCurrentPersonAddress}, which is optimized on
* database side.
*/
public function getCurrentHouseholdAddress(\DateTimeImmutable $at = null): ?Address
public function getCurrentHouseholdAddress(?\DateTimeImmutable $at = null): ?Address
{
if (
null === $at
@@ -1084,7 +1084,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return null;
}
public function getCurrentHouseholdParticipationShareHousehold(\DateTimeImmutable $at = null): ?HouseholdMember
public function getCurrentHouseholdParticipationShareHousehold(?\DateTimeImmutable $at = null): ?HouseholdMember
{
$criteria = new Criteria();
$expr = Criteria::expr();
@@ -1253,7 +1253,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @throws \Exception
*/
public function getLastAddress(\DateTime $from = null)
public function getLastAddress(?\DateTime $from = null)
{
return $this->getCurrentHouseholdAddress(
null !== $from ? \DateTimeImmutable::createFromMutable($from) : null
@@ -1381,7 +1381,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->updatedBy;
}
public function hasCurrentHouseholdAddress(\DateTimeImmutable $at = null): bool
public function hasCurrentHouseholdAddress(?\DateTimeImmutable $at = null): bool
{
return null !== $this->getCurrentHouseholdAddress($at);
}
@@ -1468,7 +1468,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return false;
}
public function isSharingHousehold(\DateTimeImmutable $at = null): bool
public function isSharingHousehold(?\DateTimeImmutable $at = null): bool
{
return null !== $this->getCurrentHousehold($at);
}
@@ -1619,7 +1619,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setCivility(Civility $civility = null): self
public function setCivility(?Civility $civility = null): self
{
$this->civility = $civility;
@@ -1637,7 +1637,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setCountryOfBirth(Country $countryOfBirth = null): self
public function setCountryOfBirth(?Country $countryOfBirth = null): self
{
$this->countryOfBirth = $countryOfBirth;
@@ -1707,7 +1707,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setMaritalStatus(MaritalStatus $maritalStatus = null): self
public function setMaritalStatus(?MaritalStatus $maritalStatus = null): self
{
$this->maritalStatus = $maritalStatus;
@@ -1748,7 +1748,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setNationality(Country $nationality = null): self
public function setNationality(?Country $nationality = null): self
{
$this->nationality = $nationality;

View File

@@ -63,7 +63,7 @@ class PersonCenterCurrent
*
* @internal Should not be instantied, unless inside Person entity
*/
public function __construct(Person\PersonCenterHistory $history)
public function __construct(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 ?Person\PersonResourceKind $kind = null;
private ?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(): ?Person\PersonResourceKind
public function getKind(): ?PersonResourceKind
{
return $this->kind;
}
@@ -196,7 +196,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function setKind(?Person\PersonResourceKind $kind): self
public function setKind(?PersonResourceKind $kind): self
{
$this->kind = $kind;

View File

@@ -116,7 +116,7 @@ class PersonAltName
/**
* @return $this
*/
public function setPerson(Person $person = null)
public function setPerson(?Person $person = null)
{
$this->person = $person;

View File

@@ -48,7 +48,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (null|string $value): string {
return function (string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_closing_date.header';
}

View File

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

View File

@@ -48,7 +48,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (null|string $value): string {
return function (string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_opening_date.header';
}

View File

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

View File

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

View File

@@ -72,7 +72,7 @@ class ChildrenNumberAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data)
{
return static function (null|int|string $value): string {
return static function (int|string|null $value): string {
if ('_header' === $value) {
return 'Number of children';
}

View File

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

View File

@@ -44,7 +44,7 @@ final readonly class PostalCodeAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (null|int|string $value): string {
return function (int|string|null $value): string {
if ('_header' === $value) {
return 'export.aggregator.person.by_postal_code.header';
}

View File

@@ -22,7 +22,7 @@ class LabelPersonHelper
public function getLabel(string $key, array $values, string $header): callable
{
return function (null|int|string $value) use ($header): string {
return function (int|string|null $value) use ($header): string {
if ('_header' === $value) {
return $header;
}

View File

@@ -27,7 +27,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface
public function __construct(
protected PersonRepository $personRepository,
array $centers = null
?array $centers = null
) {
if (null !== $centers) {
$this->centers = $centers;

View File

@@ -154,7 +154,7 @@ class PersonType extends AbstractType
'allow_delete' => true,
'by_reference' => false,
'label' => false,
'delete_empty' => static fn (PersonPhone $pp = null) => null === $pp || $pp->isEmpty(),
'delete_empty' => static fn (?PersonPhone $pp = null) => null === $pp || $pp->isEmpty(),
'error_bubbling' => false,
'empty_collection_explain' => 'No additional phone numbers',
]);

View File

@@ -53,7 +53,7 @@ class MembersEditor
* If the person is also a member of another household, or the same household at the same position, the person
* is not associated any more with the previous household.
*/
public function addMovement(\DateTimeImmutable $date, Person $person, ?Position $position, ?bool $holder = false, string $comment = null): self
public function addMovement(\DateTimeImmutable $date, Person $person, ?Position $position, ?bool $holder = false, ?string $comment = null): self
{
if (null === $this->household) {
throw new \LogicException('You must define a household first');

View File

@@ -21,7 +21,7 @@ class MembersEditorFactory
{
}
public function createEditor(Household $household = null): MembersEditor
public function createEditor(?Household $household = null): MembersEditor
{
return new MembersEditor($this->validator, $household, $this->eventDispatcher);
}

View File

@@ -73,7 +73,7 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf
return $this->entityRepository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
return $this->entityRepository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -44,7 +44,7 @@ class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectReposi
*
* @return array|object[]|AccompanyingPeriodWorkEvaluationDocument[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -53,7 +53,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository
*
* @return array|AccompanyingPeriodWorkEvaluation[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -52,7 +52,7 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor
->select('count(w)')->getQuery()->getSingleScalarResult();
}
public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@@ -67,7 +67,7 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -41,7 +41,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI
/**
* @return array|ClosingMotive[]
*/
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -108,8 +108,8 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
Person $person,
string $role,
?array $orderBy = [],
int $limit = null,
int $offset = null
?int $limit = null,
?int $offset = null
): array {
$qb = $this->accompanyingPeriodRepository->createQueryBuilder('ap');
$scopes = $this->authorizationHelper
@@ -138,7 +138,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
return $qb->getQuery()->getResult();
}
public function addOrderLimitClauses(QueryBuilder $qb, array $orderBy = null, int $limit = null, int $offset = null): QueryBuilder
public function addOrderLimitClauses(QueryBuilder $qb, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): QueryBuilder
{
if (null !== $orderBy) {
foreach ($orderBy as $field => $order) {
@@ -231,7 +231,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
return $centerOnScopes;
}
public function findByUnDispatched(array $jobs, array $services, array $administrativeAdministrativeLocations, array $orderBy = null, int $limit = null, int $offset = null): array
public function findByUnDispatched(array $jobs, array $services, array $administrativeAdministrativeLocations, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
$qb = $this->buildQueryUnDispatched($jobs, $services, $administrativeAdministrativeLocations);
$qb->select('ap');

View File

@@ -40,8 +40,8 @@ interface AccompanyingPeriodACLAwareRepositoryInterface
Person $person,
string $role,
?array $orderBy = [],
int $limit = null,
int $offset = null
?int $limit = null,
?int $offset = null
): array;
/**
@@ -51,7 +51,7 @@ interface AccompanyingPeriodACLAwareRepositoryInterface
*
* @return list<AccompanyingPeriod>
*/
public function findByUnDispatched(array $jobs, array $services, array $administrativeLocations, array $orderBy = null, int $limit = null, int $offset = null): array;
public function findByUnDispatched(array $jobs, array $services, array $administrativeLocations, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
/**
* @param array|PostalCode[] $postalCodes

View File

@@ -39,7 +39,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository
return $qb->select('count(a)')->getQuery()->getSingleScalarResult();
}
public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@@ -57,7 +57,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -49,7 +49,7 @@ final class HouseholdCompositionRepository implements HouseholdCompositionReposi
*
* @return array|object[]|HouseholdComposition[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
@@ -57,7 +57,7 @@ final class HouseholdCompositionRepository implements HouseholdCompositionReposi
/**
* @return array|HouseholdComposition[]|object[]
*/
public function findByHousehold(Household $household, array $orderBy = null, int $limit = null, int $offset = null): array
public function findByHousehold(Household $household, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
return $this->findBy(['household' => $household], $orderBy, $limit, $offset);
}

View File

@@ -32,12 +32,12 @@ interface HouseholdCompositionRepositoryInterface extends ObjectRepository
*
* @return array|object[]|HouseholdComposition[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array;
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
/**
* @return array|HouseholdComposition[]|object[]
*/
public function findByHousehold(Household $household, array $orderBy = null, int $limit = null, int $offset = null): array;
public function findByHousehold(Household $household, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
public function findOneBy(array $criteria): ?HouseholdComposition;

View File

@@ -51,7 +51,7 @@ final class HouseholdCompositionTypeRepository implements HouseholdCompositionTy
*
* @return array|HouseholdCompositionType[]|object[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -34,7 +34,7 @@ interface HouseholdCompositionTypeRepositoryInterface extends ObjectRepository
*
* @return array|HouseholdCompositionType[]|object[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array;
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
public function findOneBy(array $criteria): ?HouseholdCompositionType;

View File

@@ -65,7 +65,7 @@ final class HouseholdRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -44,12 +44,12 @@ final class PersonHouseholdAddressRepository implements ObjectRepository
*
* @return PersonHouseholdAddress[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria, array $orderBy = null): ?PersonHouseholdAddress
public function findOneBy(array $criteria, ?array $orderBy = null): ?PersonHouseholdAddress
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -49,7 +49,7 @@ final class PositionRepository implements ObjectRepository
*
* @return Position[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -34,7 +34,7 @@ class MaritalStatusRepository implements MaritalStatusRepositoryInterface
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -19,7 +19,7 @@ interface MaritalStatusRepositoryInterface
public function findAll(): array;
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array;
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
public function findOneBy(array $criteria): ?MaritalStatus;

View File

@@ -40,7 +40,7 @@ class PersonCenterHistoryRepository implements PersonCenterHistoryInterface
/**
* @return array|PersonCenterHistory[]
*/
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -30,16 +30,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor
}
public function buildAuthorizedQuery(
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): SearchApiQuery {
$query = $this->createSearchQuery(
$default,
@@ -58,16 +58,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor
}
public function countBySearchCriteria(
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): int {
$query = $this->buildAuthorizedQuery(
$default,
@@ -92,16 +92,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor
* @throws ParsingException
*/
public function createSearchQuery(
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): SearchApiQuery {
$query = new SearchApiQuery();
$query
@@ -249,16 +249,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor
int $start,
int $limit,
bool $simplify = false,
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): array {
$query = $this->buildAuthorizedQuery(
$default,

View File

@@ -17,29 +17,29 @@ use Chill\PersonBundle\Entity\Person;
interface PersonACLAwareRepositoryInterface
{
public function buildAuthorizedQuery(
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): SearchApiQuery;
public function countBySearchCriteria(
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
);
/**
@@ -49,15 +49,15 @@ interface PersonACLAwareRepositoryInterface
int $start,
int $limit,
bool $simplify = false,
string $default = null,
string $firstname = null,
string $lastname = null,
\DateTimeInterface $birthdate = null,
\DateTimeInterface $birthdateBefore = null,
\DateTimeInterface $birthdateAfter = null,
string $gender = null,
string $countryCode = null,
string $phonenumber = null,
string $city = null
?string $default = null,
?string $firstname = null,
?string $lastname = null,
?\DateTimeInterface $birthdate = null,
?\DateTimeInterface $birthdateBefore = null,
?\DateTimeInterface $birthdateAfter = null,
?string $gender = null,
?string $countryCode = null,
?string $phonenumber = null,
?string $city = null
): array;
}

View File

@@ -44,7 +44,7 @@ class PersonRepository implements ObjectRepository
return $qb->getQuery()->getSingleScalarResult();
}
public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@@ -59,7 +59,7 @@ class PersonRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -26,7 +26,7 @@ final class PersonResourceRepository implements ObjectRepository
$this->repository = $entityManager->getRepository(PersonResource::class);
}
public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@@ -50,7 +50,7 @@ final class PersonResourceRepository implements ObjectRepository
*
* @return PersonResource[]
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -35,7 +35,7 @@ class RelationRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -48,7 +48,7 @@ class RelationshipRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

View File

@@ -41,7 +41,7 @@ class ResidentialAddressRepository extends ServiceEntityRepository
->getSingleScalarResult();
}
public function buildQueryFindCurrentResidentialAddresses(Person $person, \DateTimeImmutable $at = null): QueryBuilder
public function buildQueryFindCurrentResidentialAddresses(Person $person, ?\DateTimeImmutable $at = null): QueryBuilder
{
$date = $at ?? new \DateTimeImmutable('today');
$qb = $this->createQueryBuilder('ra');
@@ -66,7 +66,7 @@ class ResidentialAddressRepository extends ServiceEntityRepository
/**
* @return array|ResidentialAddress[]|null
*/
public function findCurrentResidentialAddressByPerson(Person $person, \DateTimeImmutable $at = null): array
public function findCurrentResidentialAddressByPerson(Person $person, ?\DateTimeImmutable $at = null): array
{
return $this->buildQueryFindCurrentResidentialAddresses($person, $at)
->select('ra')

View File

@@ -48,12 +48,12 @@ final class EvaluationRepository implements EvaluationRepositoryInterface
*
* @return array<int, Evaluation>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria, array $orderBy = null): ?Evaluation
public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -34,9 +34,9 @@ interface EvaluationRepositoryInterface extends ObjectRepository
*
* @return array<int, Evaluation>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array;
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
public function findOneBy(array $criteria, array $orderBy = null): ?Evaluation;
public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation;
/**
* @return class-string

View File

@@ -56,7 +56,7 @@ final class GoalRepository implements ObjectRepository
*
* @return array<int, Goal>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
@@ -64,7 +64,7 @@ final class GoalRepository implements ObjectRepository
/**
* @return Goal[]
*/
public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], int $limit = null, int $offset = null): array
public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], ?int $limit = null, ?int $offset = null): array
{
$qb = $this->buildQueryBySocialActionWithDescendants($action);
$qb->select('g');
@@ -88,7 +88,7 @@ final class GoalRepository implements ObjectRepository
->getResult();
}
public function findOneBy(array $criteria, array $orderBy = null): ?Goal
public function findOneBy(array $criteria, ?array $orderBy = null): ?Goal
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -67,7 +67,7 @@ final class ResultRepository implements ObjectRepository
*
* @return array<int, Result>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
@@ -75,7 +75,7 @@ final class ResultRepository implements ObjectRepository
/**
* @return array<Result>
*/
public function findByGoal(Goal $goal, array $orderBy = null, int $limit = null, int $offset = null): array
public function findByGoal(Goal $goal, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{
$qb = $this->buildQueryByGoal($goal);
@@ -96,7 +96,7 @@ final class ResultRepository implements ObjectRepository
/**
* @return Result[]
*/
public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], int $limit = null, int $offset = null): array
public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], ?int $limit = null, ?int $offset = null): array
{
$qb = $this->buildQueryBySocialActionWithDescendants($action);
$qb->select('r');
@@ -112,7 +112,7 @@ final class ResultRepository implements ObjectRepository
->getResult();
}
public function findOneBy(array $criteria, array $orderBy = null): ?Result
public function findOneBy(array $criteria, ?array $orderBy = null): ?Result
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -26,7 +26,7 @@ final class SocialActionRepository implements ObjectRepository
$this->repository = $entityManager->getRepository(SocialAction::class);
}
public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@@ -58,12 +58,12 @@ final class SocialActionRepository implements ObjectRepository
*
* @return array<int, SocialAction>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria, array $orderBy = null): ?SocialAction
public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialAction
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -53,12 +53,12 @@ final class SocialIssueRepository implements ObjectRepository
*
* @return array<int, SocialIssue>
*/
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria, array $orderBy = null): ?SocialIssue
public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialIssue
{
return $this->repository->findOneBy($criteria, $orderBy);
}

View File

@@ -29,7 +29,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware
{
}
public function normalize($object, string $format = null, array $context = []): array
public function normalize($object, ?string $format = null, array $context = []): array
{
$initial = $this->normalizer->normalize($object, $format, array_merge($context, [
self::SKIP => spl_object_hash($object),
@@ -49,7 +49,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware
return $initial;
}
public function supportsNormalization($data, string $format = null, array $context = [])
public function supportsNormalization($data, ?string $format = null, array $context = [])
{
return $data instanceof AccompanyingPeriodWorkEvaluationDocument
&& 'json' === $format

View File

@@ -33,7 +33,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
/**
* @param AccompanyingPeriodWorkEvaluation $object
*/
public function normalize($object, string $format = null, array $context = []): array
public function normalize($object, ?string $format = null, array $context = []): array
{
$initial = $this->normalizer->normalize($object, $format, array_merge(
$context,
@@ -66,7 +66,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz
return $initial;
}
public function supportsNormalization($data, string $format = null, array $context = []): bool
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return 'json' === $format
&& $data instanceof AccompanyingPeriodWorkEvaluation

View File

@@ -37,7 +37,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
*
* @throws ExceptionInterface
*/
public function normalize($object, string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string
public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null
{
$initial = $this->normalizer->normalize($object, $format, array_merge(
$context,
@@ -78,7 +78,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
return $initial;
}
public function supportsNormalization($data, string $format = null, array $context = []): bool
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return 'json' === $format
&& $data instanceof AccompanyingPeriodWork

View File

@@ -36,7 +36,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA
*
* @throws ExceptionInterface
*/
public function normalize($object, string $format = null, array $context = []): array
public function normalize($object, ?string $format = null, array $context = []): array
{
$data = $this->normalizer->normalize($object, $format, array_merge(
$context,
@@ -53,7 +53,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA
return $data;
}
public function supportsNormalization($data, string $format = null, array $context = []): bool
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return 'json' === $format
&& $data instanceof EntityWorkflow

View File

@@ -33,7 +33,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen
) {
}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{
$accompanyingPeriodWorkMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWork::class);
$query = $this->buildBaseQuery();
@@ -52,7 +52,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen
return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $accompanyingPeriod);
}
private function addWhereClausesToQuery(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{
$classMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument::class);
$storedObjectMetadata = $this->entityManager->getClassMetadata(StoredObject::class);
@@ -84,7 +84,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen
return $query;
}
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{
$storedObjectMetadata = $this->entityManager->getClassMetadata(StoredObject::class);
$accompanyingPeriodWorkMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWork::class);

View File

@@ -244,10 +244,10 @@ final class PersonMoveEventSubscriberTest extends KernelTestCase
}
private function buildSubscriber(
\Twig\Environment $engine = null,
NotificationPersisterInterface $notificationPersister = null,
Security $security = null,
TranslatorInterface $translator = null
?\Twig\Environment $engine = null,
?NotificationPersisterInterface $notificationPersister = null,
?Security $security = null,
?TranslatorInterface $translator = null
): PersonAddressMoveEventSubscriber {
if (null === $translator) {
$double = $this->prophesize(TranslatorInterface::class);

View File

@@ -222,7 +222,7 @@ final class PersonControllerCreateTest extends WebTestCase
Form &$creationForm,
string $firstname = 'God',
string $lastname = 'Jesus',
\DateTime $birthdate = null
?\DateTime $birthdate = null
) {
$creationForm->get(self::FIRSTNAME_INPUT)->setValue($firstname.'_'.uniqid());
$creationForm->get(self::LASTNAME_INPUT)->setValue($lastname.'_'.uniqid());

View File

@@ -561,8 +561,8 @@ final class MembersEditorTest extends TestCase
}
private function buildMembersEditorFactory(
EventDispatcherInterface $eventDispatcher = null,
ValidatorInterface $validator = null
?EventDispatcherInterface $eventDispatcher = null,
?ValidatorInterface $validator = null
) {
if (null === $eventDispatcher) {
$double = $this->getProphet()->prophesize();

View File

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

View File

@@ -155,7 +155,7 @@ final class PersonVoterTest extends KernelTestCase
*
* @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
*/
protected function prepareToken(array $permissions = null)
protected function prepareToken(?array $permissions = null)
{
$token = $this->prophet->prophesize();
$token

View File

@@ -237,12 +237,12 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
}
private function buildNormalizer(
PersonRender $personRender = null,
RelationshipRepository $relationshipRepository = null,
TranslatorInterface $translator = null,
TranslatableStringHelper $translatableStringHelper = null,
NormalizerInterface $normalizer = null,
SummaryBudgetInterface $summaryBudget = null
?PersonRender $personRender = null,
?RelationshipRepository $relationshipRepository = null,
?TranslatorInterface $translator = null,
?TranslatableStringHelper $translatableStringHelper = null,
?NormalizerInterface $normalizer = null,
?SummaryBudgetInterface $summaryBudget = null
): PersonDocGenNormalizer {
if (null === $summaryBudget) {
$summaryBudget = $this->prophesize(SummaryBudgetInterface::class);
@@ -274,11 +274,11 @@ final class PersonDocGenNormalizerTest extends KernelTestCase
}
private function buildPersonNormalizer(
PersonRender $personRender = null,
RelationshipRepository $relationshipRepository = null,
TranslatorInterface $translator = null,
TranslatableStringHelper $translatableStringHelper = null,
SummaryBudgetInterface $summaryBudget = null
?PersonRender $personRender = null,
?RelationshipRepository $relationshipRepository = null,
?TranslatorInterface $translator = null,
?TranslatableStringHelper $translatableStringHelper = null,
?SummaryBudgetInterface $summaryBudget = null
): PersonDocGenNormalizer {
if (null === $relationshipRepository) {
$relationshipRepository = $this->prophesize(RelationshipRepository::class);

View File

@@ -341,20 +341,20 @@ final class PersonContextTest extends KernelTestCase
}
private function buildPersonContext(
AuthorizationHelperInterface $authorizationHelper = null,
BaseContextData $baseContextData = null,
CenterResolverManagerInterface $centerResolverManager = null,
DocumentCategoryRepository $documentCategoryRepository = null,
EntityManagerInterface $em = null,
NormalizerInterface $normalizer = null,
ParameterBagInterface $parameterBag = null,
ScopeRepositoryInterface $scopeRepository = null,
Security $security = null,
TranslatorInterface $translator = null,
TranslatableStringHelperInterface $translatableStringHelper = null,
ThirdPartyRender $thirdPartyRender = null,
ThirdPartyRepository $thirdPartyRepository = null,
ResidentialAddressRepository $residentialAddressRepository = null
?AuthorizationHelperInterface $authorizationHelper = null,
?BaseContextData $baseContextData = null,
?CenterResolverManagerInterface $centerResolverManager = null,
?DocumentCategoryRepository $documentCategoryRepository = null,
?EntityManagerInterface $em = null,
?NormalizerInterface $normalizer = null,
?ParameterBagInterface $parameterBag = null,
?ScopeRepositoryInterface $scopeRepository = null,
?Security $security = null,
?TranslatorInterface $translator = null,
?TranslatableStringHelperInterface $translatableStringHelper = null,
?ThirdPartyRender $thirdPartyRender = null,
?ThirdPartyRepository $thirdPartyRepository = null,
?ResidentialAddressRepository $residentialAddressRepository = null
): PersonContext {
if (null === $authorizationHelper) {
$authorizationHelper = $this->prophesize(AuthorizationHelperInterface::class)->reveal();

View File

@@ -39,9 +39,9 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC
* @dataProvider provideSearchArguments
*/
public function testBuildFetchQueryForAccompanyingPeriod(
\DateTimeImmutable $startDate = null,
\DateTimeImmutable $endDate = null,
string $content = null
?\DateTimeImmutable $startDate = null,
?\DateTimeImmutable $endDate = null,
?string $content = null
): void {
$period = $this->entityManager->createQuery('SELECT a FROM '.AccompanyingPeriod::class.' a')
->setMaxResults(1)