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

@@ -19,13 +19,12 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
*
* @EntityWorkflowCreation(groups={"creation"})
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['entity_workflow' => EntityWorkflow::class])]
@@ -72,7 +71,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
#[ORM\OneToMany(targetEntity: EntityWorkflowComment::class, mappedBy: 'entityWorkflow', orphanRemoval: true)]
private Collection $comments;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -85,13 +83,11 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private int $relatedEntityId;
/**
*
*
* @var Collection<EntityWorkflowStep>
*/
#[Assert\Valid(traverse: true)]
#[ORM\OneToMany(targetEntity: EntityWorkflowStep::class, mappedBy: 'entityWorkflow', orphanRemoval: true, cascade: ['persist'])]
#[ORM\OrderBy(['transitionAt' => \Doctrine\Common\Collections\Criteria::ASC, 'id' => 'ASC'])]
#[ORM\OrderBy(['transitionAt' => Order::Ascending, 'id' => 'ASC'])]
private Collection $steps;
/**
@@ -100,8 +96,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private ?array $stepsChainedCache = null;
/**
*
*
* @var Collection<User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
@@ -109,8 +103,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private Collection $subscriberToFinal;
/**
*
*
* @var Collection<User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]