Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
118 changed files with 143 additions and 658 deletions

View File

@@ -17,8 +17,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* RecurringTask.
*
*
*/
#[ORM\Entity(repositoryClass: \Chill\TaskBundle\Repository\RecurringTaskRepository::class)]
#[ORM\Table(name: 'chill_task.recurring_task')]
@@ -27,7 +25,6 @@ class RecurringTask extends AbstractTask
#[ORM\Column(name: 'first_occurence_end_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE)]
private ?\DateTime $firstOccurenceEndDate = null;
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -48,7 +45,7 @@ class RecurringTask extends AbstractTask
/**
* @var Collection<SingleTask>
*/
#[ORM\OneToMany(targetEntity: \SingleTask::class, mappedBy: 'recurringTask')]
#[ORM\OneToMany(targetEntity: SingleTask::class, mappedBy: 'recurringTask')]
private Collection $singleTasks;
public function __construct()

View File

@@ -13,7 +13,6 @@ namespace Chill\TaskBundle\Entity;
use Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent;
use Chill\TaskBundle\Repository\SingleTaskRepository;
use DateInterval;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@@ -22,12 +21,6 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* SingleTask.
*
*
*
*
*
*
*/
#[ORM\Entity(repositoryClass: SingleTaskRepository::class)]
#[ORM\Table(name: 'chill_task.single_task')]
@@ -41,7 +34,6 @@ class SingleTask extends AbstractTask
#[ORM\Column(name: 'end_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
private ?\DateTime $endDate = null;
#[Serializer\Groups(['read'])]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Id]

View File

@@ -55,10 +55,8 @@ class AbstractTaskPlaceEvent
/**
* Get datetime.
*
* @return datetime_immutable
*/
public function getDatetime()
public function getDatetime(): \DateTimeImmutable
{
return $this->datetime;
}
@@ -95,11 +93,9 @@ class AbstractTaskPlaceEvent
/**
* Set datetime.
*
* @param datetime_immutable $datetime
*
* @return AbstractTaskPlaceEvent
*/
public function setDatetime($datetime)
public function setDatetime(\DateTimeImmutable $datetime)
{
$this->datetime = $datetime;

View File

@@ -14,14 +14,12 @@ namespace Chill\TaskBundle\Entity\Task;
use Chill\TaskBundle\Entity\SingleTask;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'chill_task.single_task_place_event')]
#[ORM\Index(name: 'transition_task_date', columns: ['task_id', 'transition', 'datetime'])]
#[ORM\Index(name: 'transition_task', columns: ['task_id', 'transition'])]
class SingleTaskPlaceEvent extends AbstractTaskPlaceEvent
{
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]