-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor helper test w/ new interfaces
- Loading branch information
Showing
6 changed files
with
210 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the SymfonyCasts ResetPasswordBundle package. | ||
* Copyright (c) SymfonyCasts <https://symfonycasts.com/> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace SymfonyCasts\Bundle\ResetPassword\Generator; | ||
|
||
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordTokenComponents; | ||
|
||
/** | ||
* @author Jesse Rushlow <[email protected]> | ||
*/ | ||
interface ResetPasswordTokenGeneratorInterface | ||
{ | ||
public function createToken(\DateTimeInterface $expiresAt, int|string $userId, ?string $verifier = null): ResetPasswordTokenComponents; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
use SymfonyCasts\Bundle\ResetPassword\Exception\ExpiredResetPasswordTokenException; | ||
use SymfonyCasts\Bundle\ResetPassword\Exception\InvalidResetPasswordTokenException; | ||
use SymfonyCasts\Bundle\ResetPassword\Exception\TooManyPasswordRequestsException; | ||
use SymfonyCasts\Bundle\ResetPassword\Generator\ResetPasswordTokenGenerator; | ||
use SymfonyCasts\Bundle\ResetPassword\Generator\ResetPasswordTokenGeneratorInterface; | ||
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestInterface; | ||
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordToken; | ||
use SymfonyCasts\Bundle\ResetPassword\Persistence\ResetPasswordRequestRepositoryInterface; | ||
use SymfonyCasts\Bundle\ResetPassword\Util\ResetPasswordCleaner; | ||
use SymfonyCasts\Bundle\ResetPassword\Util\ResetPasswordCleanerInterface; | ||
|
||
/** | ||
* @author Jesse Rushlow <[email protected]> | ||
|
@@ -34,8 +34,8 @@ final class ResetPasswordHelper implements ResetPasswordHelperInterface | |
* @param int $requestThrottleTime Another password reset cannot be made faster than this throttle time in seconds | ||
*/ | ||
public function __construct( | ||
private ResetPasswordTokenGenerator $generator, | ||
private ResetPasswordCleaner $cleaner, | ||
private ResetPasswordTokenGeneratorInterface $generator, | ||
private ResetPasswordCleanerInterface $cleaner, | ||
private ResetPasswordRequestRepositoryInterface $repository, | ||
private int $resetRequestLifetime, | ||
private int $requestThrottleTime, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the SymfonyCasts ResetPasswordBundle package. | ||
* Copyright (c) SymfonyCasts <https://symfonycasts.com/> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace SymfonyCasts\Bundle\ResetPassword\Util; | ||
|
||
/** | ||
* @author Jesse Rushlow <[email protected]> | ||
*/ | ||
interface ResetPasswordCleanerInterface | ||
{ | ||
public function handleGarbageCollection(bool $force = false): int; | ||
} |
Oops, something went wrong.