-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
41 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,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Chiron\Pipeline\Event; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Server\RequestHandlerInterface; | ||
|
||
/** | ||
* AfterHandlerEvent is raised after the handler was executed. | ||
*/ | ||
final class AfterHandlerEvent | ||
{ | ||
/** @var RequestHandlerInterface */ | ||
private $handler; | ||
/** @var ResponseInterface|null */ | ||
private $response; | ||
|
||
/** | ||
* @param RequestHandlerInterface $handler Handler that was executed. | ||
* @param ResponseInterface|null $response Response generated by the handler or null in case there was an error. | ||
*/ | ||
public function __construct(RequestHandlerInterface $handler, ?ResponseInterface $response) | ||
{ | ||
$this->handler = $handler; | ||
$this->response = $response; | ||
} | ||
|
||
/** | ||
* @return RequestHandlerInterface | ||
*/ | ||
public function getHandler(): RequestHandlerInterface | ||
{ | ||
return $this->handler; | ||
} | ||
|
||
/** | ||
* @return ResponseInterface|null | ||
*/ | ||
public function getResponse(): ?ResponseInterface | ||
{ | ||
return $this->response; | ||
} | ||
} |
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,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Chiron\Pipeline\Event; | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
use Psr\Http\Server\RequestHandlerInterface; | ||
|
||
/** | ||
* BeforeHandlerEvent is raised before executing the fallback handler. | ||
*/ | ||
final class BeforeHandlerEvent | ||
{ | ||
/** @var RequestHandlerInterface */ | ||
private $handler; | ||
/** @var ServerRequestInterface */ | ||
private $request; | ||
|
||
/** | ||
* @param RequestHandlerInterface $handler | ||
* @param ServerRequestInterface $request | ||
*/ | ||
public function __construct(RequestHandlerInterface $handler, ServerRequestInterface $request) | ||
{ | ||
$this->handler = $handler; | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* @return RequestHandlerInterface | ||
*/ | ||
public function getHandler(): RequestHandlerInterface | ||
{ | ||
return $this->handler; | ||
} | ||
|
||
/** | ||
* @return ServerRequestInterface | ||
*/ | ||
public function getRequest(): ServerRequestInterface | ||
{ | ||
return $this->request; | ||
} | ||
} |
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