Skip to content

Commit 97aaec7

Browse files
committed
[make:registration] add missing property types
1 parent 07614b5 commit 97aaec7

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/Maker/MakeRegistrationForm.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@
6868
*/
6969
final class MakeRegistrationForm extends AbstractMaker
7070
{
71-
private $userClass;
72-
private $usernameField;
73-
private $passwordField;
74-
private $willVerifyEmail = false;
75-
private $verifyEmailAnonymously = false;
76-
private $idGetter;
77-
private $emailGetter;
78-
private $fromEmailAddress;
79-
private $fromEmailName;
71+
private string $userClass;
72+
private string $usernameField;
73+
private string $passwordField;
74+
private bool $willVerifyEmail = false;
75+
private bool $verifyEmailAnonymously = false;
76+
private string $idGetter;
77+
private string $emailGetter;
78+
private string $fromEmailAddress;
79+
private string $fromEmailName;
8080
private ?Authenticator $autoLoginAuthenticator = null;
81-
private $redirectRouteName;
82-
private $addUniqueEntityConstraint;
81+
private string $redirectRouteName;
82+
private bool $addUniqueEntityConstraint = false;
8383

8484
public function __construct(
8585
private FileManager $fileManager,
@@ -99,7 +99,7 @@ public static function getCommandDescription(): string
9999
return 'Create a new registration form system';
100100
}
101101

102-
public function configureCommand(Command $command, InputConfiguration $inputConf): void
102+
public function configureCommand(Command $command, InputConfiguration $inputConfig): void
103103
{
104104
$command
105105
->setHelp(file_get_contents(__DIR__.'/../Resources/help/MakeRegistrationForm.txt'))
@@ -135,13 +135,12 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
135135

136136
// see if it makes sense to add the UniqueEntity constraint
137137
$userClassDetails = new ClassDetails($this->userClass);
138-
$this->addUniqueEntityConstraint = false;
139138

140139
if (!$userClassDetails->hasAttribute(UniqueEntity::class)) {
141-
$this->addUniqueEntityConstraint = $io->confirm(sprintf('Do you want to add a <comment>#[UniqueEntity]</comment> validation attribute to your <comment>%s</comment> class to make sure duplicate accounts aren\'t created?', Str::getShortClassName($this->userClass)));
140+
$this->addUniqueEntityConstraint = (bool) $io->confirm(sprintf('Do you want to add a <comment>#[UniqueEntity]</comment> validation attribute to your <comment>%s</comment> class to make sure duplicate accounts aren\'t created?', Str::getShortClassName($this->userClass)));
142141
}
143142

144-
$this->willVerifyEmail = $io->confirm('Do you want to send an email to verify the user\'s email address after registration?', true);
143+
$this->willVerifyEmail = (bool) $io->confirm('Do you want to send an email to verify the user\'s email address after registration?');
145144

146145
if ($this->willVerifyEmail) {
147146
$this->checkComponentsExist($io);
@@ -151,7 +150,7 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
151150
$emailText[] = 'having to log in. To allow multi device email verification, we can embed a user id in the verification link.';
152151
$io->text($emailText);
153152
$io->newLine();
154-
$this->verifyEmailAnonymously = $io->confirm('Would you like to include the user id in the verification link to allow anonymous email verification?', false);
153+
$this->verifyEmailAnonymously = (bool) $io->confirm('Would you like to include the user id in the verification link to allow anonymous email verification?', false);
155154

156155
$this->idGetter = $interactiveSecurityHelper->guessIdGetter($io, $this->userClass);
157156
$this->emailGetter = $interactiveSecurityHelper->guessEmailGetter($io, $this->userClass, 'email');

0 commit comments

Comments
 (0)