apply rector rules: php up to php82

This commit is contained in:
2023-07-19 23:16:01 +02:00
parent 7b637d1287
commit 023a29cb78
744 changed files with 1369 additions and 1381 deletions

View File

@@ -79,21 +79,21 @@ class AccompanyingPeriod implements
TrackCreationInterface,
TrackUpdateInterface
{
public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR];
final public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR];
/**
* Mark an accompanying period as "occasional".
*
* used in INTENSITY
*/
public const INTENSITY_OCCASIONAL = 'occasional';
final public const INTENSITY_OCCASIONAL = 'occasional';
/**
* Mark an accompanying period as "regular".
*
* used in INTENSITY
*/
public const INTENSITY_REGULAR = 'regular';
final public const INTENSITY_REGULAR = 'regular';
/**
* Mark an accompanying period as "closed".
@@ -101,7 +101,7 @@ class AccompanyingPeriod implements
* This means that the accompanying period **is**
* closed by the creator
*/
public const STEP_CLOSED = 'CLOSED';
final public const STEP_CLOSED = 'CLOSED';
/**
* Mark an accompanying period as "confirmed".
@@ -109,7 +109,7 @@ class AccompanyingPeriod implements
* This means that the accompanying period **is**
* confirmed by the creator
*/
public const STEP_CONFIRMED = 'CONFIRMED';
final public const STEP_CONFIRMED = 'CONFIRMED';
/**
* Mark an accompanying period as confirmed, but inactive
@@ -118,7 +118,7 @@ class AccompanyingPeriod implements
* confirmed, but no activity (Activity, AccompanyingPeriod, ...)
* has been associated, or updated, within this accompanying period.
*/
public const STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT';
final public const STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT';
/**
* Mark an accompanying period as confirmed, but inactive
@@ -127,7 +127,7 @@ class AccompanyingPeriod implements
* confirmed, but no activity (Activity, AccompanyingPeriod, ...)
* has been associated, or updated, within this accompanying period.
*/
public const STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG';
final public const STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG';
/**
* Mark an accompanying period as "draft".
@@ -135,7 +135,7 @@ class AccompanyingPeriod implements
* This means that the accompanying period is not yet
* confirmed by the creator
*/
public const STEP_DRAFT = 'DRAFT';
final public const STEP_DRAFT = 'DRAFT';
/**
* @ORM\ManyToOne(

View File

@@ -38,23 +38,19 @@ class UserHistory implements TrackCreationInterface
*/
private ?int $id = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=false)
*/
private DateTimeImmutable $startDate;
public function __construct(/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class, inversedBy="userHistories")
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod, /**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
public function __construct(
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class, inversedBy="userHistories")
* @ORM\JoinColumn(nullable=false)
*/
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod,
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private User $user,
?DateTimeImmutable $startDate = null
private DateTimeImmutable $startDate = new DateTimeImmutable('now')
) {
$this->startDate = $startDate ?? new DateTimeImmutable('now');
}
public function getAccompanyingPeriod(): AccompanyingPeriod

View File

@@ -78,18 +78,18 @@ use function in_array;
*/
class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface, \Stringable
{
public const BOTH_GENDER = 'both';
final public const BOTH_GENDER = 'both';
// have days in commun
public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
final public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
final public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
public const FEMALE_GENDER = 'woman';
final public const FEMALE_GENDER = 'woman';
public const MALE_GENDER = 'man';
final public const MALE_GENDER = 'man';
public const NO_INFORMATION = 'unknown';
final public const NO_INFORMATION = 'unknown';
/**
* Accept receiving email.