Skip to content

Commit 3f33c8b

Browse files
alexgivisamdark
andauthored
Add MiddlewareStackInteface phpDoc
Co-authored-by: Alexander Makarov <[email protected]>
1 parent 3591c4c commit 3f33c8b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/MiddlewareStackInterface.php

+20
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,33 @@
44

55
namespace Yiisoft\Middleware\Dispatcher;
66

7+
use Psr\Http\Server\MiddlewareInterface;
78
use Psr\Http\Server\RequestHandlerInterface;
89

10+
/**
11+
* A stack of PSR-15 middlewares to be used with {@see MiddlewareDispatcher}.
12+
* @see https://www.php-fig.org/psr/psr-15/
13+
*/
914
interface MiddlewareStackInterface extends RequestHandlerInterface
1015
{
16+
/**
17+
* Builds a middleware stack from an array of middleware instances and a fallback request handler.
18+
* If the middlewares array is empty, only the fallback handler will be used.
19+
*
20+
* @param MiddlewareInterface[] $middlewares Middlewares being composed to stack. Can be empty.
21+
* @param RequestHandlerInterface $fallbackHandler Fallback request handler.
22+
*
23+
* @return self
24+
*/
1125
public function build(array $middlewares, RequestHandlerInterface $fallbackHandler): self;
1226

27+
/**
28+
* Clears the middleware stack and fallback request handler.
29+
*/
1330
public function reset(): void;
1431

32+
/**
33+
* @return bool Whether there are any middlewares or fallback request handler bound.
34+
*/
1535
public function isEmpty(): bool;
1636
}

0 commit comments

Comments
 (0)