Fix possible null values or not null values in some entity / string properties

This commit is contained in:
Julien Fastré 2023-10-17 23:15:06 +02:00
parent d54d34be7c
commit 9ec5a633ad
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
10 changed files with 30 additions and 29 deletions

View File

@ -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: ""

View File

@ -49,7 +49,7 @@ class Charge extends AbstractElement implements HasCentersInterface
/** /**
* @ORM\Column(name="help", type="string", nullable=true) * @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") * @ORM\Column(name="id", type="integer")

View File

@ -76,7 +76,7 @@ class ChargeKind
return $this->isActive; return $this->isActive;
} }
public function getKind(): ?string public function getKind(): string
{ {
return $this->kind; return $this->kind;
} }
@ -98,7 +98,7 @@ class ChargeKind
return $this; return $this;
} }
public function setKind(?string $kind): self public function setKind(string $kind): self
{ {
$this->kind = $kind; $this->kind = $kind;

View File

@ -75,7 +75,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
* min=2, max=250 * min=2, max=250
* ) * )
*/ */
private ?string $title = null; private string $title = '';
/** /**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
@ -92,7 +92,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
return $this->date; return $this->date;
} }
public function getDescription(): ?string public function getDescription(): string
{ {
return $this->description; return $this->description;
} }
@ -107,7 +107,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
return $this->template; return $this->template;
} }
public function getTitle(): ?string public function getTitle(): string
{ {
return $this->title; return $this->title;
} }

View File

@ -248,7 +248,7 @@ class AccompanyingPeriod implements
* *
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED}) * @Assert\NotBlank(groups={AccompanyingPeriod::STEP_CONFIRMED})
*/ */
private string $intensity = self::INTENSITY_OCCASIONAL; private ?string $intensity = self::INTENSITY_OCCASIONAL;
/** /**
* @ORM\ManyToOne( * @ORM\ManyToOne(
@ -414,7 +414,7 @@ class AccompanyingPeriod implements
* *
* @var AccompanyingPeriod::STEP_* * @var AccompanyingPeriod::STEP_*
*/ */
private string $step = self::STEP_DRAFT; private ?string $step = self::STEP_DRAFT;
/** /**
* @var Collection<AccompanyingPeriodStepHistory> * @var Collection<AccompanyingPeriodStepHistory>

View File

@ -62,7 +62,7 @@ class AccompanyingPeriodWorkGoal
* @Serializer\Groups({"accompanying_period_work:edit"}) * @Serializer\Groups({"accompanying_period_work:edit"})
* @Serializer\Groups({"read"}) * @Serializer\Groups({"read"})
*/ */
private ?string $note = null; private string $note = '';
/** /**
* @var Collection<Result> * @var Collection<Result>

View File

@ -49,7 +49,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
* *
* @Assert\NotNull * @Assert\NotNull
*/ */
private ?string $content = null; private string $content = '';
/** /**
* @ORM\Column(type="datetime") * @ORM\Column(type="datetime")
@ -99,7 +99,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
return $this->accompanyingPeriod; return $this->accompanyingPeriod;
} }
public function getContent(): ?string public function getContent(): string
{ {
return $this->content; return $this->content;
} }

View File

@ -234,7 +234,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* *
* @ORM\Column(type="text", nullable=true) * @ORM\Column(type="text", nullable=true)
*/ */
private string $contactInfo = ''; private ?string $contactInfo = '';
/** /**
* The person's country of birth. * The person's country of birth.
@ -298,7 +298,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* *
* @Assert\Email() * @Assert\Email()
*/ */
private string $email = ''; private ?string $email = '';
/** /**
* The person's first name. * The person's first name.
@ -319,7 +319,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* *
* @ORM\Column(type="text", nullable=true) * @ORM\Column(type="text", nullable=true)
*/ */
private string $fullnameCanonical = ''; private ?string $fullnameCanonical = '';
/** /**
* The person's gender. * The person's gender.
@ -413,7 +413,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* *
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
private string $memo = ''; // TO-CHANGE in remark private string $memo = '';
/** /**
* The person's mobile phone number. * The person's mobile phone number.

View File

@ -37,14 +37,14 @@ class PersonAltName
* *
* @Groups({"write"}) * @Groups({"write"})
*/ */
private ?string $key = null; private string $key = '';
/** /**
* @ORM\Column(name="label", type="text") * @ORM\Column(name="label", type="text")
* *
* @Groups({"write"}) * @Groups({"write"})
*/ */
private ?string $label = null; private string $label = '';
/** /**
* @ORM\ManyToOne( * @ORM\ManyToOne(
@ -92,13 +92,11 @@ class PersonAltName
/** /**
* Set key. * Set key.
* *
* @param string $key
*
* @return PersonAltName * @return PersonAltName
*/ */
public function setKey($key) public function setKey(?string $key)
{ {
$this->key = $key; $this->key = (string) $key;
return $this; return $this;
} }
@ -106,13 +104,11 @@ class PersonAltName
/** /**
* Set label. * Set label.
* *
* @param string $label
*
* @return PersonAltName * @return PersonAltName
*/ */
public function setLabel($label) public function setLabel(?string $label)
{ {
$this->label = $label; $this->label = (string) $label;
return $this; return $this;
} }

View File

@ -213,7 +213,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* *
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/ */
private string $firstname = ''; private ?string $firstname = '';
/** /**
* @ORM\Column(name="id", type="integer") * @ORM\Column(name="id", type="integer")
@ -231,7 +231,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* *
* @Groups({"write", "docgen:read", "docgen:read:3party:parent"}) * @Groups({"write", "docgen:read", "docgen:read:3party:parent"})
*/ */
private ?string $kind = ''; private string $kind = '';
/** /**
* @ORM\Column(name="name", type="string", length=255) * @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"}) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/ */
private ?string $name = ''; private string $name = '';
/** /**
* [fr] Raison sociale. * [fr] Raison sociale.
@ -770,7 +770,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
public function setKind(?string $kind): ThirdParty public function setKind(?string $kind): ThirdParty
{ {
$this->kind = $kind; $this->kind = (string) $kind;
return $this; return $this;
} }