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)]

View File

@@ -17,7 +17,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_main_workflow_entity_comment')]
class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterface
@@ -32,7 +31,6 @@ class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterf
#[ORM\ManyToOne(targetEntity: EntityWorkflow::class, inversedBy: 'comments')]
private ?EntityWorkflow $entityWorkflow = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -18,7 +18,6 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[ORM\Entity]
#[ORM\Table('chill_main_workflow_entity_step')]
class EntityWorkflowStep
@@ -28,8 +27,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_cc_user')]
@@ -46,8 +43,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user')]
@@ -55,8 +50,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user_by_accesskey')]
@@ -68,7 +61,6 @@ class EntityWorkflowStep
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $freezeAfter = false;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -93,7 +85,6 @@ class EntityWorkflowStep
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $transitionAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $transitionBy = null;