mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: apply rector rulesset up to PHP72
This commit is contained in:
@@ -200,7 +200,7 @@ class Household
|
||||
*/
|
||||
public function getCurrentAddress(?DateTime $at = null): ?Address
|
||||
{
|
||||
$at = null === $at ? new DateTime('today') : $at;
|
||||
$at = $at ?? new DateTime('today');
|
||||
|
||||
$addrs = $this->getAddresses()->filter(static function (Address $a) use ($at) {
|
||||
return $a->getValidFrom() <= $at && (
|
||||
@@ -412,7 +412,7 @@ class Household
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$expr = Criteria::expr();
|
||||
$date = null === $now ? (new DateTimeImmutable('today')) : $now;
|
||||
$date = $now ?? new DateTimeImmutable('today');
|
||||
|
||||
$criteria
|
||||
->where(
|
||||
@@ -634,7 +634,7 @@ class Household
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$expr = Criteria::expr();
|
||||
$date = null === $now ? (new DateTimeImmutable('today')) : $now;
|
||||
$date = $now ?? new DateTimeImmutable('today');
|
||||
|
||||
$criteria
|
||||
->where($expr->orX(
|
||||
|
@@ -142,7 +142,7 @@ class HouseholdMember
|
||||
|
||||
public function isCurrent(?DateTimeImmutable $at = null): bool
|
||||
{
|
||||
$at = null === $at ? new DateTimeImmutable('now') : $at;
|
||||
$at = $at ?? new DateTimeImmutable('now');
|
||||
|
||||
return $this->getStartDate() < $at && (
|
||||
null === $this->getEndDate() || $this->getEndDate() > $at
|
||||
|
@@ -1087,7 +1087,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$expr = Criteria::expr();
|
||||
$date = null === $at ? new DateTimeImmutable('today') : $at;
|
||||
$date = $at ?? new DateTimeImmutable('today');
|
||||
$datef = $date->format('Y-m-d');
|
||||
|
||||
if (
|
||||
|
Reference in New Issue
Block a user