Skip to content

Commit df64d82

Browse files
authored
[ci] php-cs-fixer it up (#283)
1 parent b79a28c commit df64d82

5 files changed

+6
-6
lines changed

src/Exception/TooManyPasswordRequestsException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class TooManyPasswordRequestsException extends \Exception implements Reset
1616
{
1717
private $availableAt;
1818

19-
public function __construct(\DateTimeInterface $availableAt, string $message = '', int $code = 0, \Throwable $previous = null)
19+
public function __construct(\DateTimeInterface $availableAt, string $message = '', int $code = 0, ?\Throwable $previous = null)
2020
{
2121
parent::__construct($message, $code, $previous);
2222

src/Generator/ResetPasswordTokenGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(string $signingKey, ResetPasswordRandomGenerator $ge
4343
* @param mixed $userId Unique user identifier
4444
* @param string $verifier Only required for token comparison
4545
*/
46-
public function createToken(\DateTimeInterface $expiresAt, $userId, string $verifier = null): ResetPasswordTokenComponents
46+
public function createToken(\DateTimeInterface $expiresAt, $userId, ?string $verifier = null): ResetPasswordTokenComponents
4747
{
4848
if (null === $verifier) {
4949
$verifier = $this->randomGenerator->getRandomAlphaNumStr();

src/Model/ResetPasswordToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class ResetPasswordToken
3535
*/
3636
private $transInterval = 0;
3737

38-
public function __construct(string $token, \DateTimeInterface $expiresAt, int $generatedAt = null)
38+
public function __construct(string $token, \DateTimeInterface $expiresAt, ?int $generatedAt = null)
3939
{
4040
$this->token = $token;
4141
$this->expiresAt = $expiresAt;

src/ResetPasswordHelper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(ResetPasswordTokenGenerator $generator, ResetPasswor
6060
*
6161
* @throws TooManyPasswordRequestsException
6262
*/
63-
public function generateResetToken(object $user, int $resetRequestLifetime = null): ResetPasswordToken
63+
public function generateResetToken(object $user, ?int $resetRequestLifetime = null): ResetPasswordToken
6464
{
6565
$this->resetPasswordCleaner->handleGarbageCollection();
6666

@@ -159,7 +159,7 @@ public function getTokenLifetime(): int
159159
*
160160
* This method should not be used when timing attacks are a concern.
161161
*/
162-
public function generateFakeResetToken(int $resetRequestLifetime = null): ResetPasswordToken
162+
public function generateFakeResetToken(?int $resetRequestLifetime = null): ResetPasswordToken
163163
{
164164
$resetRequestLifetime = $resetRequestLifetime ?? $this->resetRequestLifetime;
165165
$expiresAt = new \DateTimeImmutable(sprintf('+%d seconds', $resetRequestLifetime));

tests/ResetPasswordTestKernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ResetPasswordTestKernel extends Kernel
3636
* @param array $routes Routes to be added to the container e.g. ['name' => 'path']
3737
* @param BundleInterface[] $bundles Additional bundles to be registered e.g. [new Bundle()]
3838
*/
39-
public function __construct(ContainerBuilder $builder = null, array $routes = [], array $bundles = [])
39+
public function __construct(?ContainerBuilder $builder = null, array $routes = [], array $bundles = [])
4040
{
4141
$this->builder = $builder;
4242
$this->routes = $routes;

0 commit comments

Comments
 (0)