Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ncou committed Aug 29, 2021
1 parent 34938bc commit 1d9ac81
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ final class Pipeline implements RequestHandlerInterface
/** @var array<MiddlewareInterface> */
private $middlewares = []; // TODO : renommer la variable en $queue ???
/** @var callable */
//public $beforeMiddleware = null; // TODO : code temporaire à virer !!!


public function __construct(EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
Expand Down Expand Up @@ -111,7 +107,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
// TODO : eventuellement permettre de laisser le fallback à null et dans ce cas lever l'exception qui est présente dans la classe EmptyPipelineHandler directement à la fin de cette méthode. Ca évitera de conserver la classe EmptyPipelineHandler qui sera inutile !!!!
$this->dispatcher->dispatch(new BeforeHandlerEvent($this->fallback, $request));
try {
return $response = $this->fallback->handle($request);;
return $response = $this->fallback->handle($request);
} finally {
$this->dispatcher->dispatch(new AfterHandlerEvent($this->fallback, $response ?? null));
}
Expand Down

0 comments on commit 1d9ac81

Please sign in to comment.