-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Provide PSR-14 event to modify redirect URL parameters
Closes #19
- Loading branch information
Showing
3 changed files
with
64 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Derhansen\FeChangePwd\Event; | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
|
||
/** | ||
* This event is triggered before the change password redirect URL is created. Listeners can use this event | ||
* to change the parameters and the redirectPid used to construct the redirect URL | ||
*/ | ||
final class ModifyRedirectUrlParameterEvent | ||
{ | ||
private ServerRequestInterface $request; | ||
private int $redirectPid; | ||
private array $parameter; | ||
|
||
public function __construct(ServerRequestInterface $request, int $redirectPid, array $parameter) | ||
{ | ||
$this->request = $request; | ||
$this->redirectPid = $redirectPid; | ||
$this->parameter = $parameter; | ||
} | ||
|
||
public function getRequest(): ServerRequestInterface | ||
{ | ||
return $this->request; | ||
} | ||
|
||
public function getRedirectPid(): int | ||
{ | ||
return $this->redirectPid; | ||
} | ||
|
||
public function setRedirectPid(int $redirectPid): void | ||
{ | ||
$this->redirectPid = $redirectPid; | ||
} | ||
|
||
public function getParameter(): array | ||
{ | ||
return $this->parameter; | ||
} | ||
|
||
public function setParameter(array $parameter): void | ||
{ | ||
$this->parameter = $parameter; | ||
} | ||
} |
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