doctrine-rest icon indicating copy to clipboard operation
doctrine-rest copied to clipboard

Migrate actions to PSR-15

Open R3VoLuT1OneR opened this issue 4 years ago • 0 comments

In order to standardize package to PHP standards we must migrate our actions to PSR-15 https://www.php-fig.org/psr/psr-15

Single action must implement RequestHandlerInterface (after implementing #8 ). Each action\request handler must have single responsibility of fetching the data (single\collection) and provide the resource in the response.

Before invoking the request handler server should run group of middleware that will extend the request with attributes, like filter, include, sort. etc. This attributes can be used by request handler in order to prepare data fetching queries.

Packages provides PSR-15 interfaces: https://github.com/php-fig/http-server-handler https://github.com/php-fig/http-server-middleware

R3VoLuT1OneR avatar Aug 22 '20 10:08 R3VoLuT1OneR