Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -274,7 +274,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -289,7 +289,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
return $this->isNoAddress;
}
public function getLinkedToThirdParty()
public function getLinkedToThirdParty(): ?\Chill\ThirdPartyBundle\Entity\ThirdParty
{
return $this->linkedToThirdParty;
}
@@ -334,7 +334,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*
* @deprecated
*/
public function getStreetAddress1()
public function getStreetAddress1(): string
{
return $this->street;
}
@@ -346,7 +346,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*
* @deprecated
*/
public function getStreetAddress2()
public function getStreetAddress2(): string
{
return $this->streetNumber;
}
@@ -575,7 +575,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
*
* @param array $payload
*/
public function validate(ExecutionContextInterface $context, $payload)
public function validate(ExecutionContextInterface $context, $payload): void
{
if (!$this->getValidFrom() instanceof \DateTime) {
$context

View File

@@ -90,7 +90,7 @@ class Center implements HasCenterInterface, \Stringable
/**
* @return string
*/
public function getName()
public function getName(): string
{
return $this->name;
}

View File

@@ -36,7 +36,7 @@ class CommentEmbeddable
/**
* @return \DateTime
*/
public function getDate()
public function getDate(): ?\DateTime
{
return $this->date;
}
@@ -51,17 +51,17 @@ class CommentEmbeddable
return null === $this->getComment() || '' === $this->getComment();
}
public function setComment(?string $comment)
public function setComment(?string $comment): void
{
$this->comment = $comment;
}
public function setDate(?\DateTime $date)
public function setDate(?\DateTime $date): void
{
$this->date = $date;
}
public function setUserId(?int $userId)
public function setUserId(?int $userId): void
{
$this->userId = $userId;
}

View File

@@ -41,7 +41,7 @@ class Language
*
* @return string
*/
public function getId()
public function getId(): ?string
{
return $this->id;
}
@@ -51,7 +51,7 @@ class Language
*
* @return string array
*/
public function getName()
public function getName(): array
{
return $this->name;
}

View File

@@ -119,7 +119,7 @@ class Notification implements TrackUpdateInterface
return $this;
}
public function addAddressesEmail(string $email)
public function addAddressesEmail(string $email): void
{
if (!\in_array($email, $this->addressesEmails, true)) {
$this->addressesEmails[] = $email;
@@ -274,7 +274,7 @@ class Notification implements TrackUpdateInterface
}
#[ORM\PreFlush]
public function registerUnread()
public function registerUnread(): void
{
foreach ($this->addedAddresses as $addressee) {
$this->addUnreadBy($addressee);
@@ -312,7 +312,7 @@ class Notification implements TrackUpdateInterface
return $this;
}
public function removeAddressesEmail(string $email)
public function removeAddressesEmail(string $email): void
{
if (\in_array($email, $this->addressesEmails, true)) {
$this->addressesEmails = array_filter($this->addressesEmails, static fn ($e) => $e !== $email);

View File

@@ -57,7 +57,7 @@ class PermissionsGroup
$this->groupCenters = new ArrayCollection();
}
public function addRoleScope(RoleScope $roleScope)
public function addRoleScope(RoleScope $roleScope): void
{
$this->roleScopes->add($roleScope);
}
@@ -65,7 +65,7 @@ class PermissionsGroup
/**
* @return string[]
*/
public function getFlags()
public function getFlags(): array
{
return $this->flags;
}
@@ -73,7 +73,7 @@ class PermissionsGroup
/**
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -81,7 +81,7 @@ class PermissionsGroup
/**
* @return string
*/
public function getName()
public function getName(): string
{
return $this->name;
}
@@ -95,7 +95,7 @@ class PermissionsGroup
* Test that a role scope is associated only once
* with the permission group.
*/
public function isRoleScopePresentOnce(ExecutionContextInterface $context)
public function isRoleScopePresentOnce(ExecutionContextInterface $context): void
{
$roleScopesId = array_map(
static fn (RoleScope $roleScope) => $roleScope->getId(),
@@ -115,7 +115,7 @@ class PermissionsGroup
/**
* @throws \RuntimeException if the roleScope could not be removed
*/
public function removeRoleScope(RoleScope $roleScope)
public function removeRoleScope(RoleScope $roleScope): void
{
$result = $this->roleScopes->removeElement($roleScope);

View File

@@ -92,7 +92,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
*
* @return string
*/
public function getCode()
public function getCode(): ?string
{
return $this->code;
}
@@ -102,7 +102,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
*
* @return Country
*/
public function getCountry()
public function getCountry(): ?\Chill\MainBundle\Entity\Country
{
return $this->country;
}
@@ -112,7 +112,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
*
* @return int
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
@@ -122,7 +122,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
*
* @return string
*/
public function getName()
public function getName(): ?string
{
return $this->name;
}
@@ -132,7 +132,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
*
* @return int
*/
public function getOrigin()
public function getOrigin(): int
{
return $this->origin;
}

View File

@@ -141,7 +141,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
return $this;
}
public function eraseCredentials() {}
public function eraseCredentials(): void {}
public function getAbsenceStart(): ?\DateTimeImmutable
{
@@ -153,7 +153,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
*
* @return array
*/
public function getAttributes()
public function getAttributes(): array
{
if (null === $this->attributes) {
$this->attributes = [];
@@ -180,7 +180,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return string
*/
public function getEmailCanonical()
public function getEmailCanonical(): ?string
{
return $this->emailCanonical;
}
@@ -307,7 +307,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return string
*/
public function getUsername()
public function getUsername(): string
{
return $this->username;
}
@@ -320,7 +320,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return string
*/
public function getUsernameCanonical()
public function getUsernameCanonical(): ?string
{
return $this->usernameCanonical;
}
@@ -341,7 +341,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return bool
*/
public function isAccountNonLocked()
public function isAccountNonLocked(): bool
{
return $this->locked;
}
@@ -357,7 +357,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @return bool
*/
public function isEnabled()
public function isEnabled(): bool
{
return $this->enabled;
}
@@ -367,7 +367,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
* use this function to avoid a user to be associated to the same groupCenter
* more than once.
*/
public function isGroupCenterPresentOnce(ExecutionContextInterface $context)
public function isGroupCenterPresentOnce(ExecutionContextInterface $context): void
{
$groupCentersIds = [];
@@ -389,7 +389,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @throws \RuntimeException if the groupCenter is not in the collection
*/
public function removeGroupCenter(GroupCenter $groupCenter)
public function removeGroupCenter(GroupCenter $groupCenter): void
{
if (false === $this->groupCenters->removeElement($groupCenter)) {
throw new \RuntimeException('The groupCenter could not be removed, it seems not to be associated with the user. Aborting.');