Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] php-cs-fixer it up #283

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Exception/TooManyPasswordRequestsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class TooManyPasswordRequestsException extends \Exception implements Reset
{
private $availableAt;

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

Expand Down
2 changes: 1 addition & 1 deletion src/Generator/ResetPasswordTokenGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(string $signingKey, ResetPasswordRandomGenerator $ge
* @param mixed $userId Unique user identifier
* @param string $verifier Only required for token comparison
*/
public function createToken(\DateTimeInterface $expiresAt, $userId, string $verifier = null): ResetPasswordTokenComponents
public function createToken(\DateTimeInterface $expiresAt, $userId, ?string $verifier = null): ResetPasswordTokenComponents
{
if (null === $verifier) {
$verifier = $this->randomGenerator->getRandomAlphaNumStr();
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ResetPasswordToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class ResetPasswordToken
*/
private $transInterval = 0;

public function __construct(string $token, \DateTimeInterface $expiresAt, int $generatedAt = null)
public function __construct(string $token, \DateTimeInterface $expiresAt, ?int $generatedAt = null)
{
$this->token = $token;
$this->expiresAt = $expiresAt;
Expand Down
4 changes: 2 additions & 2 deletions src/ResetPasswordHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(ResetPasswordTokenGenerator $generator, ResetPasswor
*
* @throws TooManyPasswordRequestsException
*/
public function generateResetToken(object $user, int $resetRequestLifetime = null): ResetPasswordToken
public function generateResetToken(object $user, ?int $resetRequestLifetime = null): ResetPasswordToken
{
$this->resetPasswordCleaner->handleGarbageCollection();

Expand Down Expand Up @@ -159,7 +159,7 @@ public function getTokenLifetime(): int
*
* This method should not be used when timing attacks are a concern.
*/
public function generateFakeResetToken(int $resetRequestLifetime = null): ResetPasswordToken
public function generateFakeResetToken(?int $resetRequestLifetime = null): ResetPasswordToken
{
$resetRequestLifetime = $resetRequestLifetime ?? $this->resetRequestLifetime;
$expiresAt = new \DateTimeImmutable(sprintf('+%d seconds', $resetRequestLifetime));
Expand Down
2 changes: 1 addition & 1 deletion tests/ResetPasswordTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ResetPasswordTestKernel extends Kernel
* @param array $routes Routes to be added to the container e.g. ['name' => 'path']
* @param BundleInterface[] $bundles Additional bundles to be registered e.g. [new Bundle()]
*/
public function __construct(ContainerBuilder $builder = null, array $routes = [], array $bundles = [])
public function __construct(?ContainerBuilder $builder = null, array $routes = [], array $bundles = [])
{
$this->builder = $builder;
$this->routes = $routes;
Expand Down