DX: type-hing oneToMany and ManyToMany properties as collection

This commit is contained in:
2023-07-19 16:21:17 +02:00
parent 224c2c74e8
commit 075aca493b
32 changed files with 130 additions and 73 deletions

View File

@@ -75,7 +75,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\OneToMany(targetEntity=EntityWorkflowComment::class, mappedBy="entityWorkflow", orphanRemoval=true)
*
* @var Collection|EntityWorkflowComment[]
* @var Collection<EntityWorkflowComment>
*/
private Collection $comments;
@@ -100,7 +100,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\OneToMany(targetEntity=EntityWorkflowStep::class, mappedBy="entityWorkflow", orphanRemoval=true, cascade={"persist"})
* @ORM\OrderBy({"transitionAt": "ASC", "id": "ASC"})
* @Assert\Valid(traverse=true)
* @var Collection|EntityWorkflowStep[]
* @var Collection<EntityWorkflowStep>
*/
private Collection $steps;
@@ -113,7 +113,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_final")
*
* @var Collection|User[]
* @var Collection<User>
*/
private Collection $subscriberToFinal;
@@ -121,7 +121,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_step")
*
* @var Collection|User[]
* @var Collection<User>
*/
private Collection $subscriberToStep;

View File

@@ -33,6 +33,7 @@ class EntityWorkflowStep
private string $accessKey;
/**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_cc_user")
*/
@@ -54,12 +55,14 @@ class EntityWorkflowStep
private array $destEmail = [];
/**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user")
*/
private Collection $destUser;
/**
* @var Collection<User>
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user_by_accesskey")
*/