Skip to content

Commit

Permalink
[Rector] Applied all Symfony 5.x rectors to the production codebase (#85
Browse files Browse the repository at this point in the history
)

Applied rules:
 * AddReturnTypeDeclarationRector
 * AnnotationToAttributeRector
 * CommandConstantReturnCodeRector
  • Loading branch information
alongosz authored Aug 9, 2024
1 parent 536f68b commit b41ec1e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Command/AuditUserDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function execute(
$output->writeln('');
$output->writeln('Done.');

return 0;
return Command::SUCCESS;
}

/**
Expand Down
11 changes: 3 additions & 8 deletions src/lib/Form/Data/UserInvitationData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@

final class UserInvitationData
{
/**
* @Assert\NotBlank()
*
* @Assert\Email()
*/
#[Assert\NotBlank]
#[Assert\Email]
private string $email;

private ?Role $role;

/**
* @Assert\NotBlank()
*/
#[Assert\NotBlank]
private ?SiteAccess $siteaccess;

private ?UserGroup $userGroup;
Expand Down
6 changes: 2 additions & 4 deletions src/lib/Form/Data/UserPasswordChangeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ class UserPasswordChangeData
/**
* @UserAssert\UserPassword()
*
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $oldPassword;

/**
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $newPassword;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/lib/Form/Data/UserPasswordForgotData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
class UserPasswordForgotData
{
/**
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $email;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/lib/Form/Data/UserPasswordForgotWithLoginData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
class UserPasswordForgotWithLoginData
{
/**
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $login;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/lib/Form/Data/UserPasswordResetData.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
class UserPasswordResetData
{
/**
* @Assert\NotBlank()
*
* @var string
*/
#[Assert\NotBlank]
private $newPassword;

/**
Expand Down
4 changes: 1 addition & 3 deletions src/lib/Form/Data/UserSettingUpdateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

class UserSettingUpdateData
{
/**
* @Assert\NotBlank()
*/
#[Assert\NotBlank]
private string $identifier;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Form/Processor/UserRegisterFormProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
$this->notificationService = $notificationService;
}

public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
UserFormEvents::USER_REGISTER => ['processRegister', 20],
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/UserRegisterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public function getName()
return $this->getBlockPrefix();
}

public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'ezplatform_content_forms_user_register';
}

public function getParent()
public function getParent(): ?string
{
return BaseContentType::class;
}
Expand Down

0 comments on commit b41ec1e

Please sign in to comment.