Merge branch 'upgrade-sf5' into signature-app-master

This commit is contained in:
2024-08-28 13:23:12 +02:00
295 changed files with 14804 additions and 852 deletions

View File

@@ -92,7 +92,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
* This list is computed by a materialized view. It won't be populated until a refresh is done
* on the materialized view.
*
* @var Collection<GeographicalUnit>
* @var Collection<int, GeographicalUnit>
*
* @readonly
*/
@@ -446,7 +446,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function setLinkedToThirdParty($linkedToThirdParty): self
public function setLinkedToThirdParty(?ThirdParty $linkedToThirdParty): self
{
$this->linkedToThirdParty = $linkedToThirdParty;

View File

@@ -21,9 +21,9 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class Center implements HasCenterInterface, \Stringable
{
/**
* @var Collection<GroupCenter>
* @var Collection<int, GroupCenter>
*/
#[ORM\OneToMany(targetEntity: GroupCenter::class, mappedBy: 'center')]
#[ORM\OneToMany(mappedBy: 'center', targetEntity: GroupCenter::class)]
private Collection $groupCenters;
#[Serializer\Groups(['docgen:read'])]
@@ -40,7 +40,7 @@ class Center implements HasCenterInterface, \Stringable
private bool $isActive = true;
/**
* @var Collection<Regroupment>
* @var Collection<int, Regroupment>
*/
#[ORM\ManyToMany(targetEntity: Regroupment::class, mappedBy: 'centers')]
private Collection $regroupments;
@@ -111,7 +111,7 @@ class Center implements HasCenterInterface, \Stringable
/**
* @return $this
*/
public function setName($name)
public function setName(string $name)
{
$this->name = $name;

View File

@@ -61,10 +61,7 @@ class CommentEmbeddable
$this->date = $date;
}
/**
* @param int $userId
*/
public function setUserId($userId)
public function setUserId(?int $userId)
{
$this->userId = $userId;
}

View File

@@ -57,7 +57,7 @@ class PrivateCommentEmbeddable
return $this;
}
public function setComments($comments)
public function setComments(array $comments)
{
$this->comments = $comments;

View File

@@ -36,9 +36,9 @@ class GeographicalUnitLayer
private string $refId = '';
/**
* @var Collection<GeographicalUnit>
* @var Collection<int, GeographicalUnit>
*/
#[ORM\OneToMany(targetEntity: GeographicalUnit::class, mappedBy: 'layer')]
#[ORM\OneToMany(mappedBy: 'layer', targetEntity: GeographicalUnit::class)]
private Collection $units;
public function __construct()

View File

@@ -34,7 +34,7 @@ class GroupCenter
private ?PermissionsGroup $permissionsGroup = null;
/**
* @var Collection<User::class>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'groupCenters')]
private Collection $users;

View File

@@ -59,11 +59,9 @@ class Language
/**
* Set id.
*
* @param string $id
*
* @return Language
*/
public function setId($id)
public function setId(?string $id)
{
$this->id = $id;
@@ -77,7 +75,7 @@ class Language
*
* @return Language
*/
public function setName($name)
public function setName(array $name)
{
$this->name = $name;

View File

@@ -30,7 +30,7 @@ class Notification implements TrackUpdateInterface
private array $addedAddresses = [];
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_notification_addresses_user')]
@@ -54,9 +54,9 @@ class Notification implements TrackUpdateInterface
private ?ArrayCollection $addressesOnLoad = null;
/**
* @var Collection<NotificationComment>
* @var Collection<int, NotificationComment>
*/
#[ORM\OneToMany(targetEntity: NotificationComment::class, mappedBy: 'notification', orphanRemoval: true)]
#[ORM\OneToMany(mappedBy: 'notification', targetEntity: NotificationComment::class, orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::ASC])]
private Collection $comments;
@@ -88,7 +88,7 @@ class Notification implements TrackUpdateInterface
private string $title = '';
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_notification_addresses_unread')]

View File

@@ -28,9 +28,9 @@ class PermissionsGroup
private array $flags = [];
/**
* @var Collection<GroupCenter>
* @var Collection<int, GroupCenter>
*/
#[ORM\OneToMany(targetEntity: GroupCenter::class, mappedBy: 'permissionsGroup')]
#[ORM\OneToMany(mappedBy: 'permissionsGroup', targetEntity: GroupCenter::class)]
private Collection $groupCenters;
#[ORM\Id]
@@ -42,7 +42,7 @@ class PermissionsGroup
private string $name = '';
/**
* @var Collection<RoleScope>
* @var Collection<int, RoleScope>
*/
#[ORM\ManyToMany(targetEntity: RoleScope::class, inversedBy: 'permissionsGroups', cascade: ['persist'])]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
@@ -137,7 +137,7 @@ class PermissionsGroup
/**
* @return $this
*/
public function setName($name)
public function setName(string $name)
{
$this->name = $name;

View File

@@ -157,11 +157,9 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
/**
* Set code.
*
* @param string $code
*
* @return PostalCode
*/
public function setCode($code)
public function setCode(?string $code)
{
$this->code = $code;
@@ -183,11 +181,9 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
/**
* Set name.
*
* @param string $name
*
* @return PostalCode
*/
public function setName($name)
public function setName(?string $name)
{
$this->name = $name;
@@ -197,11 +193,9 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
/**
* Set origin.
*
* @param int $origin
*
* @return PostalCode
*/
public function setOrigin($origin)
public function setOrigin(int $origin)
{
$this->origin = $origin;

View File

@@ -20,7 +20,7 @@ use Doctrine\ORM\Mapping as ORM;
class Regroupment
{
/**
* @var Collection<Center>
* @var Collection<int, Center>
*/
#[ORM\ManyToMany(targetEntity: Center::class, inversedBy: 'regroupments')]
#[ORM\Id]

View File

@@ -26,7 +26,7 @@ class RoleScope
private ?int $id = null;
/**
* @var Collection<PermissionsGroup>
* @var Collection<int, PermissionsGroup>
*/
#[ORM\ManyToMany(targetEntity: PermissionsGroup::class, mappedBy: 'roleScopes')]
private Collection $permissionsGroups;

View File

@@ -42,9 +42,9 @@ class Scope
private array $name = [];
/**
* @var Collection<RoleScope>
* @var Collection<int, RoleScope>
*/
#[ORM\OneToMany(targetEntity: RoleScope::class, mappedBy: 'scope')]
#[ORM\OneToMany(mappedBy: 'scope', targetEntity: RoleScope::class)]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private Collection $roleScopes;

View File

@@ -64,7 +64,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
private bool $enabled = true;
/**
* @var Collection<GroupCenter>
* @var Collection<int, \Chill\MainBundle\Entity\GroupCenter>
*/
#[ORM\ManyToMany(targetEntity: GroupCenter::class, inversedBy: 'users')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
@@ -83,9 +83,9 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
private ?Location $mainLocation = null;
/**
* @var Collection&Selectable<int, UserScopeHistory>
* @var \Doctrine\Common\Collections\Collection<int, \Chill\MainBundle\Entity\User\UserScopeHistory>&Selectable
*/
#[ORM\OneToMany(targetEntity: UserScopeHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserScopeHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection&Selectable $scopeHistories;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
@@ -98,9 +98,9 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
private ?string $salt = null;
/**
* @var Collection&Selectable<int, UserJobHistory>
* @var \Doctrine\Common\Collections\Collection<int, \Chill\MainBundle\Entity\User\UserJobHistory>&Selectable
*/
#[ORM\OneToMany(targetEntity: UserJobHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserJobHistory::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection&Selectable $jobHistories;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80)]
@@ -437,7 +437,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return $this
*/
public function setEmail($email)
public function setEmail(?string $email)
{
$this->email = $email;
@@ -447,7 +447,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return $this
*/
public function setEmailCanonical($emailCanonical)
public function setEmailCanonical(?string $emailCanonical)
{
$this->emailCanonical = $emailCanonical;
@@ -521,7 +521,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return $this
*/
public function setPassword($password)
public function setPassword(string $password)
{
$this->password = $password;
@@ -531,7 +531,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return $this
*/
public function setSalt($salt)
public function setSalt(?string $salt)
{
$this->salt = $salt;
@@ -593,7 +593,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return $this
*/
public function setUsernameCanonical($usernameCanonical)
public function setUsernameCanonical(?string $usernameCanonical)
{
$this->usernameCanonical = $usernameCanonical;

View File

@@ -35,7 +35,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
/**
* @var Collection<EntityWorkflowComment>
* @var Collection<int, \Chill\MainBundle\Entity\Workflow\EntityWorkflowComment>
*/
#[ORM\OneToMany(targetEntity: EntityWorkflowComment::class, mappedBy: 'entityWorkflow', orphanRemoval: true)]
private Collection $comments;
@@ -52,10 +52,10 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private int $relatedEntityId;
/**
* @var Collection<EntityWorkflowStep>
* @var Collection<int, EntityWorkflowStep>
*/
#[Assert\Valid(traverse: true)]
#[ORM\OneToMany(targetEntity: EntityWorkflowStep::class, mappedBy: 'entityWorkflow', orphanRemoval: true, cascade: ['persist'])]
#[ORM\OneToMany(mappedBy: 'entityWorkflow', targetEntity: EntityWorkflowStep::class, cascade: ['persist'], orphanRemoval: true)]
#[ORM\OrderBy(['transitionAt' => \Doctrine\Common\Collections\Criteria::ASC, 'id' => 'ASC'])]
private Collection $steps;
@@ -65,14 +65,14 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private ?array $stepsChainedCache = null;
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_subscriber_to_final')]
private Collection $subscriberToFinal;
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_subscriber_to_step')]
@@ -247,12 +247,16 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
return $this->steps;
}
/**
* @throws \Exception
*/
public function getStepsChained(): array
{
if (\is_array($this->stepsChainedCache)) {
return $this->stepsChainedCache;
}
/** @var \ArrayIterator $iterator */
$iterator = $this->steps->getIterator();
$current = null;
$steps = [];

View File

@@ -26,7 +26,7 @@ class EntityWorkflowStep
private string $accessKey;
/**
* @var Collection<User>
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_cc_user')]