diff --git a/.changes/unreleased/Fixed-20231017-231446.yaml b/.changes/unreleased/Fixed-20231017-231446.yaml new file mode 100644 index 000000000..135c17b7e --- /dev/null +++ b/.changes/unreleased/Fixed-20231017-231446.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Fix possible null values in string's entities +time: 2023-10-17T23:14:46.099913795+02:00 +custom: + Issue: "" diff --git a/src/Bundle/ChillBudgetBundle/Entity/Charge.php b/src/Bundle/ChillBudgetBundle/Entity/Charge.php index 68ee65d19..d6af5cc1e 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Charge.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Charge.php @@ -49,7 +49,7 @@ class Charge extends AbstractElement implements HasCentersInterface /** * @ORM\Column(name="help", type="string", nullable=true) */ - private string $help = self::HELP_NOT_RELEVANT; + private ?string $help = self::HELP_NOT_RELEVANT; /** * @ORM\Column(name="id", type="integer") diff --git a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php index 308575677..2196a0e99 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php +++ b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php @@ -76,7 +76,7 @@ class ChargeKind return $this->isActive; } - public function getKind(): ?string + public function getKind(): string { return $this->kind; } @@ -98,7 +98,7 @@ class ChargeKind return $this; } - public function setKind(?string $kind): self + public function setKind(string $kind): self { $this->kind = $kind; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/Document.php b/src/Bundle/ChillDocStoreBundle/Entity/Document.php index 786939a41..e4990b1b8 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/Document.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/Document.php @@ -75,7 +75,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface * min=2, max=250 * ) */ - private ?string $title = null; + private string $title = ''; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") @@ -92,7 +92,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface return $this->date; } - public function getDescription(): ?string + public function getDescription(): string { return $this->description; } @@ -107,7 +107,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface return $this->template; } - public function getTitle(): ?string + public function getTitle(): string { return $this->title; } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index fd65c1cfe..4302a17f4 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -248,7 +248,7 @@ class AccompanyingPeriod implements * * @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED}) */ - private string $intensity = self::INTENSITY_OCCASIONAL; + private ?string $intensity = self::INTENSITY_OCCASIONAL; /** * @ORM\ManyToOne( @@ -414,7 +414,7 @@ class AccompanyingPeriod implements * * @var AccompanyingPeriod::STEP_* */ - private string $step = self::STEP_DRAFT; + private ?string $step = self::STEP_DRAFT; /** * @var Collection diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php index f02ade804..a569f3a9d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php @@ -62,7 +62,7 @@ class AccompanyingPeriodWorkGoal * @Serializer\Groups({"accompanying_period_work:edit"}) * @Serializer\Groups({"read"}) */ - private ?string $note = null; + private string $note = ''; /** * @var Collection diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index aed611d80..81a84c64a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -49,7 +49,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface * * @Assert\NotNull */ - private ?string $content = null; + private string $content = ''; /** * @ORM\Column(type="datetime") @@ -99,7 +99,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this->accompanyingPeriod; } - public function getContent(): ?string + public function getContent(): string { return $this->content; } diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 1adc695b0..57c1a0314 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -234,7 +234,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\Column(type="text", nullable=true) */ - private string $contactInfo = ''; + private ?string $contactInfo = ''; /** * The person's country of birth. @@ -298,7 +298,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @Assert\Email() */ - private string $email = ''; + private ?string $email = ''; /** * The person's first name. @@ -319,7 +319,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\Column(type="text", nullable=true) */ - private string $fullnameCanonical = ''; + private ?string $fullnameCanonical = ''; /** * The person's gender. @@ -413,7 +413,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\Column(type="text") */ - private string $memo = ''; // TO-CHANGE in remark + private string $memo = ''; /** * The person's mobile phone number. diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php index d899cee68..9b6b24621 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php @@ -37,14 +37,14 @@ class PersonAltName * * @Groups({"write"}) */ - private ?string $key = null; + private string $key = ''; /** * @ORM\Column(name="label", type="text") * * @Groups({"write"}) */ - private ?string $label = null; + private string $label = ''; /** * @ORM\ManyToOne( @@ -92,13 +92,11 @@ class PersonAltName /** * Set key. * - * @param string $key - * * @return PersonAltName */ - public function setKey($key) + public function setKey(?string $key) { - $this->key = $key; + $this->key = (string) $key; return $this; } @@ -106,13 +104,11 @@ class PersonAltName /** * Set label. * - * @param string $label - * * @return PersonAltName */ - public function setLabel($label) + public function setLabel(?string $label) { - $this->label = $label; + $this->label = (string) $label; return $this; } diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index f777e2323..f4ad5293c 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -213,7 +213,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) */ - private string $firstname = ''; + private ?string $firstname = ''; /** * @ORM\Column(name="id", type="integer") @@ -231,7 +231,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @Groups({"write", "docgen:read", "docgen:read:3party:parent"}) */ - private ?string $kind = ''; + private string $kind = ''; /** * @ORM\Column(name="name", type="string", length=255) @@ -244,7 +244,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) */ - private ?string $name = ''; + private string $name = ''; /** * [fr] Raison sociale. @@ -770,7 +770,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin public function setKind(?string $kind): ThirdParty { - $this->kind = $kind; + $this->kind = (string) $kind; return $this; }