From e4e52234addfc2863970eba616ac55b4af8c9e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 31 Aug 2023 10:35:52 +0200 Subject: [PATCH] Rector: apply rules for doctrine code quality --- rector.php | 1 + .../Entity/ActivityReasonCategory.php | 2 +- .../Entity/CalendarRange.php | 2 +- .../Entity/CancelReason.php | 2 +- .../Entity/CustomField.php | 8 +++---- .../Entity/CustomFieldLongChoice/Option.php | 2 +- .../Entity/CustomFieldsDefaultGroup.php | 6 ++--- .../Entity/CustomFieldsGroup.php | 4 ++-- .../ChillDocStoreBundle/Entity/Document.php | 6 ++--- .../Entity/DocumentCategory.php | 2 +- .../Entity/PersonDocument.php | 2 +- .../Controller/EventController.php | 2 +- src/Bundle/ChillEventBundle/Entity/Event.php | 22 +++++-------------- .../ChillEventBundle/Entity/EventType.php | 6 ++--- .../ChillEventBundle/Entity/Participation.php | 2 +- src/Bundle/ChillEventBundle/Entity/Role.php | 6 ++--- src/Bundle/ChillEventBundle/Entity/Status.php | 6 ++--- .../Entity/Embeddable/CommentEmbeddable.php | 2 +- .../Entity/PermissionsGroup.php | 6 ++--- .../ChillMainBundle/Entity/PostalCode.php | 6 ++--- .../Entity/AccompanyingPeriod.php | 2 -- .../Household/PersonHouseholdAddress.php | 6 ++--- .../ChillPersonBundle/Entity/Person.php | 17 +++++++++----- .../Entity/Person/ResidentialAddress.php | 2 +- .../Entity/PersonAltName.php | 6 ++--- .../Entity/PersonNotDuplicate.php | 2 +- .../Entity/SocialWork/SocialIssue.php | 2 +- .../ChillReportBundle/Entity/Report.php | 9 +++----- .../ChillTaskBundle/Entity/RecurringTask.php | 12 ++++------ .../ChillTaskBundle/Entity/SingleTask.php | 9 +++----- .../Entity/Task/AbstractTaskPlaceEvent.php | 2 +- .../Entity/Task/SingleTaskPlaceEvent.php | 2 +- 32 files changed, 74 insertions(+), 92 deletions(-) diff --git a/rector.php b/rector.php index d626793ce..2d35b37ec 100644 --- a/rector.php +++ b/rector.php @@ -26,6 +26,7 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([ LevelSetList::UP_TO_PHP_82, \Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_44, + \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, ]); // some routes are added twice if it remains activated diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php index 0522d5037..65a414758 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php @@ -36,7 +36,7 @@ class ActivityReasonCategory implements \Stringable * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var string diff --git a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php index 5dbc4286f..6bd44aeca 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php @@ -55,7 +55,7 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface * @ORM\Column(type="integer") * @Groups({"read"}) */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne(targetEntity=Location::class) diff --git a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php index c8be951fe..6ed74e8d9 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php @@ -41,7 +41,7 @@ class CancelReason * @ORM\GeneratedValue * @ORM\Column(type="integer") */ - private $id; + private ?int $id = null; /** * @ORM\Column(type="json") diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index 4c466d20e..509f53a38 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -45,7 +45,7 @@ class CustomField * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var array @@ -64,7 +64,7 @@ class CustomField * * @ORM\Column(type="float") */ - private $ordering; + private ?float $ordering = null; /** * @ORM\Column(type="boolean") @@ -76,14 +76,14 @@ class CustomField * * @ORM\Column(type="string", length=255) */ - private $slug; + private ?string $slug = null; /** * @var string * * @ORM\Column(type="string", length=255) */ - private $type; + private ?string $type = null; /** * Get customFieldGroup. diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php index 92d228659..964160de6 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -42,7 +42,7 @@ class Option * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @ORM\Column(type="string", length=50, name="internal_key") diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php index 15e37b5f7..6e509d176 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php @@ -34,14 +34,14 @@ class CustomFieldsDefaultGroup * * sf4 check: option inversedBy="customFields" return inconsistent error mapping !! */ - private $customFieldsGroup; + private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $customFieldsGroup = null; /** * @var string * * @ORM\Column(type="string", length=255) */ - private $entity; + private ?string $entity = null; /** * @var int @@ -50,7 +50,7 @@ class CustomFieldsDefaultGroup * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * Get customFieldsGroup. diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php index 5cc58253c..7ede1a08a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php @@ -46,7 +46,7 @@ class CustomFieldsGroup * * @ORM\Column(type="string", length=255) */ - private $entity; + private ?string $entity = null; /** * @var int @@ -55,7 +55,7 @@ class CustomFieldsGroup * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var array diff --git a/src/Bundle/ChillDocStoreBundle/Entity/Document.php b/src/Bundle/ChillDocStoreBundle/Entity/Document.php index fa2909af1..c06ef15bc 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/Document.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/Document.php @@ -54,7 +54,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface * @ORM\GeneratedValue * @ORM\Column(type="integer") */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne( @@ -83,10 +83,8 @@ class Document implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") - * - * @var \Chill\PersonBundle\Entity\user The user who encoded the exif_read_data */ - private $user; + private ?\Chill\MainBundle\Entity\User $user = null; public function getCategory(): ?DocumentCategory { diff --git a/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php b/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php index b4cd54e1b..a922b3b1f 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php @@ -24,7 +24,7 @@ class DocumentCategory * * @var string The class of the document (ie Chill\DocStoreBundle\PersonDocument) */ - private $documentClass; + private ?string $documentClass = null; /** * @ORM\Column(type="json") diff --git a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php index 1124cbbfd..e646a5ed7 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php @@ -33,7 +33,7 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt * * @var \Chill\MainBundle\Entity\Scope The document's center */ - private $scope; + private ?\Chill\MainBundle\Entity\Scope $scope = null; public function getCenter() { diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index aacd4b0a1..681c18b40 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -516,7 +516,7 @@ class EventController extends AbstractController 'A5' => 'Circle', 'B5' => $event->getCircle()->getName()[$trans], 'A6' => 'Moderator', - 'B6' => $event->getModerator() ? $event->getModerator()->getUsernameCanonical() : null, + 'B6' => null !== $event->getModerator() ? $event->getModerator()->getUsernameCanonical() : null, ]; foreach ($headerValues as $k => $value) { diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index be1ceffeb..17f7899fc 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -45,7 +45,7 @@ class Event implements HasCenterInterface, HasScopeInterface /** * @ORM\Column(type="datetime") */ - private ?\DateTime $date = null; + private ?\DateTime $date; /** * @var int @@ -54,19 +54,17 @@ class Event implements HasCenterInterface, HasScopeInterface * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** - * @var User * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") */ - private $moderator; + private ?\Chill\MainBundle\Entity\User $moderator = null; /** - * @var string * @ORM\Column(type="string", length=150) */ - private $name; + private ?string $name = null; /** * @var Collection @@ -137,10 +135,7 @@ class Event implements HasCenterInterface, HasScopeInterface return $this->id; } - /** - * @return int - */ - public function getModerator() + public function getModerator(): User|null { return $this->moderator; } @@ -235,12 +230,7 @@ class Event implements HasCenterInterface, HasScopeInterface return $this; } - /** - * @param int $moderator - * - * @return Event - */ - public function setModerator($moderator) + public function setModerator(User $moderator): self { $this->moderator = $moderator; diff --git a/src/Bundle/ChillEventBundle/Entity/EventType.php b/src/Bundle/ChillEventBundle/Entity/EventType.php index 3a5f858b3..b61a3f1f9 100644 --- a/src/Bundle/ChillEventBundle/Entity/EventType.php +++ b/src/Bundle/ChillEventBundle/Entity/EventType.php @@ -26,9 +26,9 @@ class EventType { /** * @var bool - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", nullable=false) */ - private $active; + private bool $active = true; /** * @var int @@ -37,7 +37,7 @@ class EventType * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var array diff --git a/src/Bundle/ChillEventBundle/Entity/Participation.php b/src/Bundle/ChillEventBundle/Entity/Participation.php index d7d3ab399..3a84175bc 100644 --- a/src/Bundle/ChillEventBundle/Entity/Participation.php +++ b/src/Bundle/ChillEventBundle/Entity/Participation.php @@ -48,7 +48,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @ORM\Column(type="datetime") diff --git a/src/Bundle/ChillEventBundle/Entity/Role.php b/src/Bundle/ChillEventBundle/Entity/Role.php index 878065261..82e36ba0f 100644 --- a/src/Bundle/ChillEventBundle/Entity/Role.php +++ b/src/Bundle/ChillEventBundle/Entity/Role.php @@ -24,9 +24,9 @@ class Role { /** * @var bool - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", nullable=false) */ - private $active; + private bool $active = true; /** * @var int @@ -35,7 +35,7 @@ class Role * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var array diff --git a/src/Bundle/ChillEventBundle/Entity/Status.php b/src/Bundle/ChillEventBundle/Entity/Status.php index b6a987429..805b602d3 100644 --- a/src/Bundle/ChillEventBundle/Entity/Status.php +++ b/src/Bundle/ChillEventBundle/Entity/Status.php @@ -24,9 +24,9 @@ class Status { /** * @var bool - * @ORM\Column(type="boolean") + * @ORM\Column(type="boolean", nullable=false) */ - private $active; + private bool $active = true; /** * @var int @@ -35,7 +35,7 @@ class Status * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var array diff --git a/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php b/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php index 5bc60f2a5..b22928a94 100644 --- a/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php +++ b/src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php @@ -35,7 +35,7 @@ class CommentEmbeddable * @var int * @ORM\Column(type="integer", nullable=true) */ - private $userId; + private ?int $userId = null; public function getComment(): ?string { diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index a834d4f37..7d909b167 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -47,14 +47,14 @@ class PermissionsGroup * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var string * - * @ORM\Column(type="string", length=255) + * @ORM\Column(type="string", length=255, nullable=false, options={"default": ""}) */ - private $name; + private string $name = ''; /** * @var Collection diff --git a/src/Bundle/ChillMainBundle/Entity/PostalCode.php b/src/Bundle/ChillMainBundle/Entity/PostalCode.php index 57880cb67..3754f9c77 100644 --- a/src/Bundle/ChillMainBundle/Entity/PostalCode.php +++ b/src/Bundle/ChillMainBundle/Entity/PostalCode.php @@ -65,7 +65,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * @ORM\Column(type="string", length=100) * @groups({"write", "read"}) */ - private $code; + private ?string $code = null; /** * @@ -87,7 +87,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * @ORM\GeneratedValue(strategy="AUTO") * @groups({"write", "read"}) */ - private $id; + private ?int $id = null; /** * @var string @@ -95,7 +95,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * @ORM\Column(type="string", length=255, name="label") * @groups({"write", "read"}) */ - private $name; + private ?string $name = null; /** * diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 4d70cbf12..2224f307b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -249,8 +249,6 @@ class AccompanyingPeriod implements private Collection $locationHistories; /** - * @var DateTime - * * @ORM\Column(type="date") * @Groups({"read", "write", "docgen:read"}) * @Assert\LessThan(value="tomorrow", groups={AccompanyingPeriod::STEP_CONFIRMED}) diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php b/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php index 5fecc04b6..6a1e34ba9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php @@ -51,21 +51,21 @@ class PersonHouseholdAddress * @ORM\ManyToOne(targetEntity=Address::class) * @ORM\JoinColumn(nullable=false) */ - private $address; + private ?\Chill\MainBundle\Entity\Address $address = null; /** * @ORM\Id * @ORM\ManyToOne(targetEntity=Household::class) * @ORM\JoinColumn(nullable=false) */ - private $household; + private ?\Chill\PersonBundle\Entity\Household\Household $household = null; /** * @ORM\Id * @ORM\ManyToOne(targetEntity=Person::class) * @ORM\JoinColumn(nullable=false) */ - private $person; + private ?\Chill\PersonBundle\Entity\Person $person = null; /** * @ORM\Column(type="date_immutable") diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index d67b1c379..440f8ced7 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -158,12 +158,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * The person's birthdate. * - * @var DateTime - * * @ORM\Column(type="date", nullable=true) * @Birthdate */ - private $birthdate; + private ?\DateTime $birthdate = null; /** * @var Collection @@ -184,7 +182,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI private Collection $budgetResources; /** - * @var Collection + * @var Collection * @ORM\ManyToMany( * targetEntity="Chill\CalendarBundle\Entity\Calendar", * mappedBy="persons" @@ -397,8 +395,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * The date of the last marital status change of the person. * - * @var DateTime - * * @ORM\Column(type="date", nullable=true) * @Assert\Date */ @@ -527,6 +523,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI */ public function __construct() { + $this->calendars = new \Doctrine\Common\Collections\ArrayCollection(); $this->accompanyingPeriodParticipations = new ArrayCollection(); $this->spokenLanguages = new ArrayCollection(); $this->addresses = new ArrayCollection(); @@ -929,6 +926,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this->budgetResources; } + /** + * @return Collection + */ + public function getCalendars(): Collection + { + return $this->calendars; + } + public function getCenter(): ?Center { if (null !== $this->centerCurrent) { diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php index 26e57ad00..9ff2a29e2 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php @@ -65,7 +65,7 @@ class ResidentialAddress * @ORM\GeneratedValue * @ORM\Column(type="integer") */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne(targetEntity=Person::class) diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php index 2ab6aaf36..d899366a8 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php @@ -29,7 +29,7 @@ class PersonAltName * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @var string @@ -37,7 +37,7 @@ class PersonAltName * @ORM\Column(name="key", type="string", length=255) * @Groups({"write"}) */ - private $key; + private ?string $key = null; /** * @var string @@ -45,7 +45,7 @@ class PersonAltName * @ORM\Column(name="label", type="text") * @Groups({"write"}) */ - private $label; + private ?string $label = null; /** * @ORM\ManyToOne( diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php b/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php index 24bbf9b2b..12a96896f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php @@ -37,7 +37,7 @@ class PersonNotDuplicate * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php index 773b90dfd..4ace48639 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -43,7 +43,7 @@ class SocialIssue * @ORM\GeneratedValue * @ORM\Column(type="integer") */ - private $id; + private ?int $id = null; /** * @ORM\Column(type="float", name="ordering", options={"default": 0.0}) diff --git a/src/Bundle/ChillReportBundle/Entity/Report.php b/src/Bundle/ChillReportBundle/Entity/Report.php index 655fd4b4b..7b6a25104 100644 --- a/src/Bundle/ChillReportBundle/Entity/Report.php +++ b/src/Bundle/ChillReportBundle/Entity/Report.php @@ -42,10 +42,9 @@ class Report implements HasCenterInterface, HasScopeInterface private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $cFGroup = null; /** - * @var DateTime * @ORM\Column(type="datetime") */ - private $date; + private ?\DateTime $date = null; /** * @var int @@ -54,7 +53,7 @@ class Report implements HasCenterInterface, HasScopeInterface * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") @@ -101,10 +100,8 @@ class Report implements HasCenterInterface, HasScopeInterface /** * Get date. - * - * @return DateTime */ - public function getDate() + public function getDate(): ?DateTime { return $this->date; } diff --git a/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php b/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php index 33495a295..e196bc611 100644 --- a/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/RecurringTask.php @@ -25,11 +25,9 @@ use Doctrine\ORM\Mapping as ORM; class RecurringTask extends AbstractTask { /** - * @var DateTime - * * @ORM\Column(name="first_occurence_end_date", type="date") */ - private $firstOccurenceEndDate; + private ?\DateTime $firstOccurenceEndDate = null; /** * @var int @@ -38,21 +36,19 @@ class RecurringTask extends AbstractTask * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** - * @var DateTime - * * @ORM\Column(name="last_occurence_end_date", type="date") */ - private $lastOccurenceEndDate; + private ?\DateTime $lastOccurenceEndDate = null; /** * @var string * * @ORM\Column(name="occurence_frequency", type="string", length=255) */ - private $occurenceFrequency; + private ?string $occurenceFrequency = null; /** * diff --git a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php index 921c495e7..92a7a24cc 100644 --- a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php @@ -46,13 +46,11 @@ use Symfony\Component\Validator\Constraints as Assert; class SingleTask extends AbstractTask { /** - * @var DateTime - * * @ORM\Column(name="end_date", type="date", nullable=true) * @Assert\Date * @Serializer\Groups({"read"}) */ - private $endDate; + private ?\DateTime $endDate = null; /** * @var int @@ -62,7 +60,7 @@ class SingleTask extends AbstractTask * @ORM\GeneratedValue(strategy="AUTO") * @Serializer\Groups({"read"}) */ - private $id; + private ?int $id = null; /** * @ORM\ManyToOne( @@ -73,7 +71,6 @@ class SingleTask extends AbstractTask private ?\Chill\TaskBundle\Entity\RecurringTask $recurringTask = null; /** - * @var DateTime * * @ORM\Column(name="start_date", type="date", nullable=true) * @Serializer\Groups({"read"}) @@ -89,7 +86,7 @@ class SingleTask extends AbstractTask * message="The start date must be before warning date" * ) */ - private $startDate; + private ?\DateTime $startDate = null; /** * @var Collection diff --git a/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php b/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php index 26f250aff..962eb6536 100644 --- a/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php +++ b/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php @@ -48,7 +48,7 @@ class AbstractTaskPlaceEvent * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id = null; /** * @ORM\Column(name="transition", type="string", length=255) diff --git a/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php b/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php index 366403520..4cb7c013a 100644 --- a/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php +++ b/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php @@ -38,7 +38,7 @@ class SingleTaskPlaceEvent extends AbstractTaskPlaceEvent * inversedBy="taskPlaceEvents" * ) */ - protected $task; + protected ?\Chill\TaskBundle\Entity\SingleTask $task = null; public function getTask(): SingleTask {