Skip to content

Commit bfbe7c7

Browse files
committed
Merge branch '10.0' of github.com:moufmouf/mvc.splash-ui into 10.0
2 parents d93aff5 + 74c2acd commit bfbe7c7

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

src/Mouf/Mvc/Splash/ConditionMiddleware.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ public function __construct(ToCondition $condition, MiddlewareInterface $ifMiddl
4343
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
4444
{
4545
if($this->condition->isOk()) {
46-
$this->ifMiddleware->process($request, $handler);
46+
return $this->ifMiddleware->process($request, $handler);
4747
} else if($this->elseMiddleware) {
48-
$this->elseMiddleware->process($request, $handler);
48+
return $this->elseMiddleware->process($request, $handler);
4949
} else {
50-
$handler->handle($request);
50+
return $handler->handle($request);
5151
}
5252
}
5353
}

src/Mouf/Mvc/Splash/Controllers/Admin/SplashCreateControllerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Mouf\Html\HtmlElement\HtmlBlock;
88
use Mouf\Html\Utils\WebLibraryManager\WebLibrary;
99
use Mouf\MoufManager;
10-
use TheCodingMachine\Splash\Controllers\Controller;
10+
use Mouf\Mvc\Splash\Controllers\Controller;
1111
use TheCodingMachine\Splash\Services\SplashCreateControllerService;
1212
use TheCodingMachine\Splash\Services\SplashCreateControllerServiceException;
1313

src/Mouf/Mvc/Splash/MiddlewarePipe.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Check out the Splash documentation here:
2222
* <a href="https://github.com/thecodingmachine/mvc.splash/">https://github.com/thecodingmachine/mvc.splash/</a>.
2323
*/
24-
class MiddlewarePipe implements MiddlewareInterface
24+
class MiddlewarePipe implements MiddlewareInterface, RequestHandlerInterface
2525
{
2626
private $zendPipe;
2727

@@ -47,5 +47,24 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
4747
return $this->zendPipe->process($request, $handler);
4848
}
4949

50+
/**
51+
* Handle an incoming request.
52+
*
53+
* Attempts to handle an incoming request by doing the following:
54+
*
55+
* - Cloning itself, to produce a request handler.
56+
* - Dequeuing the first middleware in the cloned handler.
57+
* - Processing the first middleware using the request and the cloned handler.
58+
*
59+
* If the pipeline is empty at the time this method is invoked, it will
60+
* raise an exception.
61+
*
62+
* @throws Exception\EmptyPipelineException if no middleware is present in
63+
* the instance in order to process the request.
64+
*/
65+
public function handle(ServerRequestInterface $request) : ResponseInterface
66+
{
67+
return $this->zendPipe->handle($request);
68+
}
5069

5170
}

0 commit comments

Comments
 (0)