apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\Center;
use Chill\PersonBundle\Entity\Person;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
/**
@@ -23,7 +22,9 @@ use Doctrine\ORM\Mapping as ORM;
* using a SQL view.
*
* @ORM\Entity(readOnly=true)
*
* @ORM\Table(name="view_chill_person_person_center_history_current")
*
* @psalm-internal Chill\PersonBundle\Entity
*/
class PersonCenterCurrent
@@ -36,10 +37,11 @@ class PersonCenterCurrent
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
private ?DateTimeImmutable $endDate = null;
private ?\DateTimeImmutable $endDate = null;
/**
* @ORM\Id
*
* @ORM\Column(type="integer")
*/
private ?int $id = null;
@@ -52,7 +54,7 @@ class PersonCenterCurrent
/**
* @ORM\Column(type="date_immutable", nullable=false)
*/
private DateTimeImmutable $startDate;
private \DateTimeImmutable $startDate;
/**
* Populate the properties person, center, start and end date from history.
@@ -75,7 +77,7 @@ class PersonCenterCurrent
return $this->center;
}
public function getEndDate(): ?DateTimeImmutable
public function getEndDate(): ?\DateTimeImmutable
{
return $this->endDate;
}
@@ -93,7 +95,7 @@ class PersonCenterCurrent
return $this->person;
}
public function getStartDate(): DateTimeImmutable
public function getStartDate(): \DateTimeImmutable
{
return $this->startDate;
}

View File

@@ -17,13 +17,13 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\Center;
use Chill\PersonBundle\Entity\Person;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
/**
* Associate a Person with a Center. The association may change on date intervals.
*
* @ORM\Entity
*
* @ORM\Table(name="chill_person_person_center_history")
*/
class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterface
@@ -35,11 +35,13 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*/
private ?DateTimeImmutable $endDate = null;
private ?\DateTimeImmutable $endDate = null;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
private ?int $id = null;
@@ -48,11 +50,11 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
/**
* @ORM\ManyToOne(targetEntity=Person::class, inversedBy="centerHistory")
*/
private ?\Chill\PersonBundle\Entity\Person $person = null,
private ?Person $person = null,
/**
* @ORM\ManyToOne(targetEntity=Center::class)
*/
private ?\Chill\MainBundle\Entity\Center $center = null,
private ?Center $center = null,
/**
* @ORM\Column(type="date_immutable", nullable=false)
*/
@@ -64,7 +66,7 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
return $this->center;
}
public function getEndDate(): ?DateTimeImmutable
public function getEndDate(): ?\DateTimeImmutable
{
return $this->endDate;
}
@@ -79,7 +81,7 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
return $this->person;
}
public function getStartDate(): ?DateTimeImmutable
public function getStartDate(): ?\DateTimeImmutable
{
return $this->startDate;
}
@@ -91,7 +93,7 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
return $this;
}
public function setEndDate(?DateTimeImmutable $endDate): self
public function setEndDate(?\DateTimeImmutable $endDate): self
{
$this->endDate = $endDate;
@@ -105,7 +107,7 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
return $this;
}
public function setStartDate(?DateTimeImmutable $startDate): self
public function setStartDate(?\DateTimeImmutable $startDate): self
{
$this->startDate = $startDate;

View File

@@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\Address;
use Chill\PersonBundle\Entity\Person;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
/**
@@ -26,6 +25,7 @@ use Doctrine\ORM\Mapping as ORM;
* household membership and address validity. See @see{PersonHouseholdAddress}
*
* @ORM\Entity(readOnly=true)
*
* @ORM\Table("view_chill_person_current_address")
*/
class PersonCurrentAddress
@@ -37,7 +37,9 @@ class PersonCurrentAddress
/**
* @ORM\Id
*
* @ORM\OneToOne(targetEntity=Person::class, inversedBy="currentPersonAddress")
*
* @ORM\JoinColumn(name="person_id", referencedColumnName="id")
*/
protected Person $person;
@@ -45,12 +47,12 @@ class PersonCurrentAddress
/**
* @ORM\Column(name="valid_from", type="date_immutable")
*/
protected DateTimeImmutable $validFrom;
protected \DateTimeImmutable $validFrom;
/**
* @ORM\Column(name="valid_to", type="date_immutable")
*/
protected ?DateTimeImmutable $validTo = null;
protected ?\DateTimeImmutable $validTo = null;
public function getAddress(): Address
{
@@ -66,7 +68,7 @@ class PersonCurrentAddress
* This date is the intersection of household membership
* and address validity.
*/
public function getValidFrom(): DateTimeImmutable
public function getValidFrom(): \DateTimeImmutable
{
return $this->validFrom;
}
@@ -75,7 +77,7 @@ class PersonCurrentAddress
* This date is the intersection of household membership
* and address validity.
*/
public function getValidTo(): ?DateTimeImmutable
public function getValidTo(): ?\DateTimeImmutable
{
return $this->validTo;
}

View File

@@ -26,7 +26,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* @ORM\Entity
*
* @ORM\Table(name="chill_person_resource")
*
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
* "personResource": personResource::class
* })
@@ -39,27 +41,34 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
*
* @Serializer\Groups({"read", "docgen:read"})
*/
private CommentEmbeddable $comment;
/**
* @ORM\Column(type="text", nullable=true)
*
* @Groups({"read", "docgen:read"})
*/
private ?string $freeText = null;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Groups({"read", "docgen:read"})
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=PersonResourceKind::class, inversedBy="personResources")
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read", "docgen:read"})
*/
private ?PersonResourceKind $kind = null;
@@ -68,7 +77,9 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
* The person which host the owner of this resource.
*
* @ORM\ManyToOne(targetEntity=Person::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read", "docgen:read"})
*/
private ?Person $person = null;
@@ -77,14 +88,18 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
* The person linked with this resource.
*
* @ORM\ManyToOne(targetEntity=Person::class, inversedBy="resources")
*
* @ORM\JoinColumn(nullable=false)
*
* @Groups({"read"})
*/
private ?Person $personOwner = null;
/**
* @ORM\ManyToOne(targetEntity=ThirdParty::class, inversedBy="personResources")
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read", "docgen:read"})
*/
private ?ThirdParty $thirdParty = null;

View File

@@ -16,14 +16,18 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
*
* @ORM\Table(name="chill_person_resource_kind")
*/
class PersonResourceKind
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"docgen:read"})
*/
private ?int $id = null;
@@ -35,7 +39,9 @@ class PersonResourceKind
/**
* @ORM\Column(type="json", length=255)
*
* @Serializer\Groups({"docgen:read"})
*
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $title;

View File

@@ -16,20 +16,22 @@ use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Repository\ResidentialAddressRepository;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=ResidentialAddressRepository::class)
*
* @ORM\Table(name="chill_person_residential_address")
*/
class ResidentialAddress
{
/**
* @ORM\ManyToOne(targetEntity=Address::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read"})
*/
private ?Address $address = null;
@@ -41,43 +43,53 @@ class ResidentialAddress
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*
* @Groups({"read"})
*/
private ?DateTimeImmutable $endDate = null;
private ?\DateTimeImmutable $endDate = null;
/**
* @ORM\ManyToOne(targetEntity=Person::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read"})
*
* @Context(normalizationContext={"groups": {"minimal"}})
*/
private ?Person $hostPerson = null;
/**
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Groups({"read"})
*/
private ?ThirdParty $hostThirdParty = null;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=Person::class)
*
* @ORM\JoinColumn(nullable=false)
*/
private Person $person;
/**
* @ORM\Column(type="datetime_immutable")
*
* @Groups({"read"})
*/
private ?DateTimeImmutable $startDate = null;
private ?\DateTimeImmutable $startDate = null;
public function __construct()
{
@@ -94,7 +106,7 @@ class ResidentialAddress
return $this->comment;
}
public function getEndDate(): ?DateTimeImmutable
public function getEndDate(): ?\DateTimeImmutable
{
return $this->endDate;
}
@@ -119,7 +131,7 @@ class ResidentialAddress
return $this->person;
}
public function getStartDate(): ?DateTimeImmutable
public function getStartDate(): ?\DateTimeImmutable
{
return $this->startDate;
}
@@ -138,7 +150,7 @@ class ResidentialAddress
return $this;
}
public function setEndDate(?DateTimeImmutable $endDate): self
public function setEndDate(?\DateTimeImmutable $endDate): self
{
$this->endDate = $endDate;
@@ -166,7 +178,7 @@ class ResidentialAddress
return $this;
}
public function setStartDate(DateTimeImmutable $startDate): self
public function setStartDate(\DateTimeImmutable $startDate): self
{
$this->startDate = $startDate;