Skip to content

Commit 59cf7d0

Browse files
committed
Fix CS
1 parent 5ffe4fd commit 59cf7d0

32 files changed

+58
-58
lines changed

src/Command/ActivateUserCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5656

5757
$this->userManipulator->activate($username);
5858

59-
$output->writeln(sprintf('User "%s" has been activated.', $username));
59+
$output->writeln(\sprintf('User "%s" has been activated.', $username));
6060

6161
return 0;
6262
}

src/Command/ChangePasswordCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6565

6666
$this->userManipulator->changePassword($username, $password);
6767

68-
$output->writeln(sprintf('Changed password for user <comment>%s</comment>', $username));
68+
$output->writeln(\sprintf('Changed password for user <comment>%s</comment>', $username));
6969

7070
return 0;
7171
}

src/Command/CreateUserCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080

8181
$this->userManipulator->create($username, $password, $email, !$inactive, $superadmin);
8282

83-
$output->writeln(sprintf('Created user <comment>%s</comment>', $username));
83+
$output->writeln(\sprintf('Created user <comment>%s</comment>', $username));
8484

8585
return 0;
8686
}

src/Command/DeactivateUserCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5656

5757
$this->userManipulator->deactivate($username);
5858

59-
$output->writeln(sprintf('User "%s" has been deactivated.', $username));
59+
$output->writeln(\sprintf('User "%s" has been deactivated.', $username));
6060

6161
return 0;
6262
}

src/Command/DemoteUserCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ protected function executeRoleCommand(UserManipulator $manipulator, OutputInterf
4040
{
4141
if ($super) {
4242
$manipulator->demote($username);
43-
$output->writeln(sprintf('User "%s" has been demoted as a simple user. This change will not apply until the user logs out and back in again.', $username));
43+
$output->writeln(\sprintf('User "%s" has been demoted as a simple user. This change will not apply until the user logs out and back in again.', $username));
4444
} elseif ($manipulator->removeRole($username, $role)) {
45-
$output->writeln(sprintf('Role "%s" has been removed from user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
45+
$output->writeln(\sprintf('Role "%s" has been removed from user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
4646
} else {
47-
$output->writeln(sprintf('User "%s" didn\'t have "%s" role.', $username, $role));
47+
$output->writeln(\sprintf('User "%s" didn\'t have "%s" role.', $username, $role));
4848
}
4949
}
5050
}

src/Command/PromoteUserCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ protected function executeRoleCommand(UserManipulator $manipulator, OutputInterf
4040
{
4141
if ($super) {
4242
$manipulator->promote($username);
43-
$output->writeln(sprintf('User "%s" has been promoted as a super administrator. This change will not apply until the user logs out and back in again.', $username));
43+
$output->writeln(\sprintf('User "%s" has been promoted as a super administrator. This change will not apply until the user logs out and back in again.', $username));
4444
} elseif ($manipulator->addRole($username, $role)) {
45-
$output->writeln(sprintf('Role "%s" has been added to user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
45+
$output->writeln(\sprintf('Role "%s" has been added to user "%s". This change will not apply until the user logs out and back in again.', $role, $username));
4646
} else {
47-
$output->writeln(sprintf('User "%s" did already have "%s" role.', $username, $role));
47+
$output->writeln(\sprintf('User "%s" did already have "%s" role.', $username, $role));
4848
}
4949
}
5050
}

src/DependencyInjection/NucleosUserExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function load(array $configs, ContainerBuilder $container): void
7373
$loader->load('doctrine.php');
7474
$container->setAlias('nucleos_user.doctrine_registry', new Alias(self::$doctrineDrivers[$config['db_driver']]['registry'], false));
7575
} else {
76-
$loader->load(sprintf('%s.php', $config['db_driver']));
76+
$loader->load(\sprintf('%s.php', $config['db_driver']));
7777
}
7878
$container->setParameter($this->getAlias().'.backend_type_'.$config['db_driver'], true);
7979
}
@@ -84,7 +84,7 @@ public function load(array $configs, ContainerBuilder $container): void
8484
}
8585

8686
foreach (['validator', 'security', 'util', 'mailer', 'listeners', 'commands'] as $basename) {
87-
$loader->load(sprintf('%s.php', $basename));
87+
$loader->load(\sprintf('%s.php', $basename));
8888
}
8989

9090
if (!$config['use_authentication_listener']) {
@@ -186,7 +186,7 @@ private function remapParametersNamespaces(array $config, ContainerBuilder $cont
186186
$this->remapParameters($namespaceConfig, $container, $map);
187187
} else {
188188
foreach ($namespaceConfig as $name => $value) {
189-
$container->setParameter(sprintf($map, $name), $value);
189+
$container->setParameter(\sprintf($map, $name), $value);
190190
}
191191
}
192192
}
@@ -234,7 +234,7 @@ private function loadGroups(array $config, ContainerBuilder $container, FileLoad
234234
if (isset(self::$doctrineDrivers[$dbDriver])) {
235235
$loader->load('doctrine_group.php');
236236
} else {
237-
$loader->load(sprintf('%s_group.php', $dbDriver));
237+
$loader->load(\sprintf('%s_group.php', $dbDriver));
238238
}
239239
}
240240

src/Event/GetResponseLoginEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class GetResponseLoginEvent extends Event
2121

2222
private ?Response $response = null;
2323

24-
public function __construct(Request $request = null)
24+
public function __construct(?Request $request = null)
2525
{
2626
$this->request = $request;
2727
}

src/Event/UserEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UserEvent extends Event
2323

2424
protected readonly UserInterface $user;
2525

26-
public function __construct(UserInterface $user, Request $request = null)
26+
public function __construct(UserInterface $user, ?Request $request = null)
2727
{
2828
$this->user = $user;
2929
$this->request = $request;

src/Model/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function setPlainPassword(?string $password): void
208208
$this->passwordRequestedAt = null;
209209
}
210210

211-
public function setLastLogin(DateTime $time = null): void
211+
public function setLastLogin(?DateTime $time = null): void
212212
{
213213
$this->lastLogin = $time;
214214
}
@@ -218,7 +218,7 @@ public function setConfirmationToken(?string $confirmationToken): void
218218
$this->confirmationToken = $confirmationToken;
219219
}
220220

221-
public function setPasswordRequestedAt(DateTime $date = null): void
221+
public function setPasswordRequestedAt(?DateTime $date = null): void
222222
{
223223
$this->passwordRequestedAt = $date;
224224
}

0 commit comments

Comments
 (0)