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

This commit is contained in:
2023-10-17 23:15:06 +02:00
parent d54d34be7c
commit 9ec5a633ad
10 changed files with 30 additions and 29 deletions

View File

@@ -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<AccompanyingPeriodStepHistory>

View File

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

View File

@@ -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;
}

View File

@@ -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.

View File

@@ -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;
}