diff --git a/Embryo/Http/Server/RequestHandler.php b/Embryo/Http/Server/RequestHandler.php index cf10b5a..9c3b6cd 100644 --- a/Embryo/Http/Server/RequestHandler.php +++ b/Embryo/Http/Server/RequestHandler.php @@ -29,7 +29,7 @@ class RequestHandler implements RequestHandlerInterface protected $middleware = []; /** - * @var array $middleware + * @var ResponseInterface $response */ protected $response; @@ -46,7 +46,9 @@ public function __construct(array $middleware = []) /** * Add a middleware to the end of the queue. * - * @param string|MiddlewareInterface $middleware + * @param string|MiddlewareInterface $middleware + * @return void + * @throws \InvalidArgumentException */ public function add($middleware) { @@ -62,6 +64,8 @@ public function add($middleware) * Add a middleware to the beginning of the queue. * * @param string|MiddlewareInterface $middleware + * @return void + * @throws \InvalidArgumentException */ public function prepend($middleware) { @@ -78,6 +82,7 @@ public function prepend($middleware) * * @param ServerRequestInterface $request * @param ResponseInterface $response + * @return ResponseInterface */ public function dispatch(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface { diff --git a/composer.json b/composer.json index d1dd04b..7ae1869 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,13 @@ "require": { "php": ">=7.1", "psr/http-server-handler": "1.0.0", - "psr/http-server-middleware": "1.0.0" + "psr/http-server-middleware": "1.0.0", + "davidecesarano/embryo-http": "dev-master" }, "require-dev": { - "davidecesarano/embryo-http": "dev-master", "middlewares/response-time": "v1.0.0", - "middlewares/uuid": "v1.0.0" + "middlewares/uuid": "v1.0.0", + "phpstan/phpstan": "^0.12.55" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..1ad9dc8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +parameters: + checkMissingIterableValueType: false + treatPhpDocTypesAsCertain: false + checkGenericClassInNonGenericObjectType: false + level: max + paths: + - Embryo + - example \ No newline at end of file