cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,9 +1,17 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Entity\SocialWork;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@@ -13,14 +21,34 @@ use Symfony\Component\Serializer\Annotation as Serializer;
* @ORM\Entity
* @ORM\Table(name="chill_person_social_work_result")
* @Serializer\DiscriminatorMap(
* typeProperty="type",
* mapping={
* "social_work_result":Result::class
* }
* )
* typeProperty="type",
* mapping={
* "social_work_result": Result::class
* }
* )
*/
class Result
{
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results")
*/
private $accompanyingPeriodWorkGoals;
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results")
*/
private $accompanyingPeriodWorks;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $desactivationDate;
/**
* @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results")
*/
private $goals;
/**
* @ORM\Id
* @ORM\GeneratedValue
@@ -29,36 +57,16 @@ class Result
*/
private $id;
/**
* @ORM\Column(type="json")
* @Serializer\Groups({"read"})
*/
private $title = [];
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $desactivationDate;
/**
* @ORM\ManyToMany(targetEntity=SocialAction::class, mappedBy="results")
*/
private $socialActions;
/**
* @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results")
* @ORM\Column(type="json")
* @Serializer\Groups({"read"})
*/
private $goals;
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWork::class, mappedBy="results")
*/
private $accompanyingPeriodWorks;
/**
* @ORM\ManyToMany(targetEntity=AccompanyingPeriodWorkGoal::class, mappedBy="results")
*/
private $accompanyingPeriodWorkGoals;
private $title = [];
public function __construct()
{
@@ -68,91 +76,6 @@ class Result
$this->accompanyingPeriodWorkGoals = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): array
{
return $this->title;
}
public function setTitle(array $title): self
{
$this->title = $title;
return $this;
}
public function getDesactivationDate(): ?\DateTimeInterface
{
return $this->desactivationDate;
}
public function setDesactivationDate(?\DateTimeInterface $desactivationDate): self
{
$this->desactivationDate = $desactivationDate;
return $this;
}
/**
* @return Collection|SocialAction[]
*/
public function getSocialActions(): Collection
{
return $this->socialActions;
}
public function addSocialAction(SocialAction $socialAction): self
{
if (!$this->socialActions->contains($socialAction)) {
$this->socialActions[] = $socialAction;
}
return $this;
}
public function removeSocialAction(SocialAction $socialAction): self
{
$this->socialActions->removeElement($socialAction);
return $this;
}
/**
* @return Collection|Goal[]
*/
public function getGoals(): Collection
{
return $this->goals;
}
public function addGoal(Goal $goal): self
{
if (!$this->goals->contains($goal)) {
$this->goals[] = $goal;
}
return $this;
}
public function removeGoal(Goal $goal): self
{
$this->goals->removeElement($goal);
return $this;
}
/**
* @return Collection|AccompanyingPeriodWork[]
*/
public function getAccompanyingPeriodWorks(): Collection
{
return $this->accompanyingPeriodWorks;
}
public function addAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self
{
if (!$this->accompanyingPeriodWorks->contains($accompanyingPeriod)) {
@@ -162,26 +85,83 @@ class Result
return $this;
}
public function removeAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self
public function addAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self
{
$this->accompanyingPeriodWorks->removeElement($accompanyingPeriod);
if (!$this->accompanyingPeriodWorkGoals->contains($accompanyingPeriodWorkGoal)) {
$this->accompanyingPeriodWorkGoals[] = $accompanyingPeriodWorkGoal;
}
return $this;
}
public function addGoal(Goal $goal): self
{
if (!$this->goals->contains($goal)) {
$this->goals[] = $goal;
}
return $this;
}
public function addSocialAction(SocialAction $socialAction): self
{
if (!$this->socialActions->contains($socialAction)) {
$this->socialActions[] = $socialAction;
}
return $this;
}
/**
* @return Collection|AccompanyingPeriodWorkGoal[]
* @return AccompanyingPeriodWorkGoal[]|Collection
*/
public function getAccompanyingPeriodWorkGoals(): Collection
{
return $this->accompanyingPeriodWorkGoals;
}
public function addAccompanyingPeriodWorkGoal(AccompanyingPeriodWorkGoal $accompanyingPeriodWorkGoal): self
/**
* @return AccompanyingPeriodWork[]|Collection
*/
public function getAccompanyingPeriodWorks(): Collection
{
if (!$this->accompanyingPeriodWorkGoals->contains($accompanyingPeriodWorkGoal)) {
$this->accompanyingPeriodWorkGoals[] = $accompanyingPeriodWorkGoal;
}
return $this->accompanyingPeriodWorks;
}
public function getDesactivationDate(): ?DateTimeInterface
{
return $this->desactivationDate;
}
/**
* @return Collection|Goal[]
*/
public function getGoals(): Collection
{
return $this->goals;
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection|SocialAction[]
*/
public function getSocialActions(): Collection
{
return $this->socialActions;
}
public function getTitle(): array
{
return $this->title;
}
public function removeAccompanyingPeriodWork(AccompanyingPeriodWork $accompanyingPeriod): self
{
$this->accompanyingPeriodWorks->removeElement($accompanyingPeriod);
return $this;
}
@@ -192,4 +172,32 @@ class Result
return $this;
}
public function removeGoal(Goal $goal): self
{
$this->goals->removeElement($goal);
return $this;
}
public function removeSocialAction(SocialAction $socialAction): self
{
$this->socialActions->removeElement($socialAction);
return $this;
}
public function setDesactivationDate(?DateTimeInterface $desactivationDate): self
{
$this->desactivationDate = $desactivationDate;
return $this;
}
public function setTitle(array $title): self
{
$this->title = $title;
return $this;
}
}