Apply new rector rules regarding to PHP version to 8.4

This commit is contained in:
2025-11-03 13:36:51 +01:00
parent d6f5ef4bb1
commit cdc489f01e
1086 changed files with 2219 additions and 1378 deletions

View File

@@ -65,9 +65,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface, \Stringable
{
// have days in commun
final public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
final public const int ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
final public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
final public const int ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
/**
* Accept receiving email.
@@ -772,10 +772,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* If the `$at` parameter is now, use the method `getCurrentPersonAddress`, which is optimized
* on database side.
*
* @deprecated since chill2.0, address is linked to the household. Use @see{Person::getCurrentHouseholdAddress}
*
* @throws \Exception
*/
#[\Deprecated(message: 'since chill2.0, address is linked to the household. Use @see{Person::getCurrentHouseholdAddress}')]
public function getAddressAt(?\DateTimeInterface $at = null): ?Address
{
$at ??= new \DateTime('now');
@@ -933,9 +933,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* Returns the opened accompanying period.
*
* @deprecated since 1.1 use `getOpenedAccompanyingPeriod instead
*/
#[\Deprecated(message: 'since 1.1 use `getOpenedAccompanyingPeriod instead')]
public function getCurrentAccompanyingPeriod(): ?AccompanyingPeriod
{
return $this->getOpenedAccompanyingPeriod();
@@ -981,7 +980,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
{
if (
null === $at
|| $at->format('Ymd') === (new \DateTime('today'))->format('Ymd')
|| $at->format('Ymd') === new \DateTime('today')->format('Ymd')
) {
return $this->currentPersonAddress instanceof PersonCurrentAddress
? $this->currentPersonAddress->getAddress() : null;
@@ -1169,12 +1168,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
}
/**
* @deprecated Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead
*
* @return false|mixed|null
*
* @throws \Exception
*/
#[\Deprecated(message: 'Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead')]
public function getLastAddress(?\DateTime $from = null): ?Address
{
return $this->getCurrentHouseholdAddress(
@@ -1391,13 +1389,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*/
public function isOpen(): bool
{
foreach ($this->getAccompanyingPeriods() as $period) {
if ($period->isOpen()) {
return true;
}
}
return false;
return array_any($this->getAccompanyingPeriods(), fn($period) => $period->isOpen());
}
public function isSharingHousehold(?\DateTimeImmutable $at = null): bool