Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:01:30 +02:00
parent 579bd829f8
commit 72016e1a21
124 changed files with 1724 additions and 3770 deletions

View File

@@ -23,70 +23,45 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* AbstractTask.
*
* @ORM\MappedSuperclass
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['single_task' => SingleTask::class])]
#[ORM\MappedSuperclass]
abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
{
/**
* @ORM\ManyToOne(
* targetEntity="\Chill\MainBundle\Entity\User"
* )
*/
#[Serializer\Groups(['read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
private ?User $assignee = null;
/**
* @ORM\ManyToOne(
* targetEntity="\Chill\MainBundle\Entity\Scope"
* )
*/
#[ORM\ManyToOne(targetEntity: Scope::class)]
private ?Scope $circle = null;
/**
* @ORM\Column(name="closed", type="boolean", options={ "default": false })
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'closed', type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $closed = false;
/**
* @ORM\ManyToOne(targetEntity="\Chill\PersonBundle\Entity\AccompanyingPeriod")
*/
#[Serializer\Groups(['read'])]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
private ?AccompanyingPeriod $course = null;
/**
* @ORM\Column(name="current_states", type="json", options={"jsonb"=true, "default"="[]"})
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'current_states', type: \Doctrine\DBAL\Types\Types::JSON, options: ['jsonb' => true, 'default' => '[]'])]
private array $currentStates = [];
/**
* @ORM\Column(name="description", type="text")
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'description', type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $description = '';
/**
* @ORM\ManyToOne(
* targetEntity="\Chill\PersonBundle\Entity\Person"
* )
*/
#[Serializer\Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
private ?Person $person = null;
/**
* @ORM\Column(name="title", type="text")
*/
#[Assert\NotBlank]
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'title', type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $title = '';
/**
* @ORM\Column(name="type", type="string", length=255)
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'type', type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $type = null;
public function getAssignee(): ?User
@@ -101,8 +76,6 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
}
return $this->getCourse()->getCenter();
return null;
}
public function getCircle(): ?Scope