| Total Complexity | 5 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 0 | ||
| 1 | <?php namespace Pz\Doctrine\Rest; |
||
| 3 | abstract class RestActionAbstract |
||
| 4 | { |
||
| 5 | /** |
||
| 6 | * @var RestRepository |
||
| 7 | */ |
||
| 8 | protected $repository; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var RestResponseFactory |
||
| 12 | */ |
||
| 13 | protected $response; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param RestRequest $request |
||
| 17 | * |
||
| 18 | * @return RestResponse |
||
| 19 | */ |
||
| 20 | abstract protected function handle(RestRequest $request); |
||
| 21 | |||
| 22 | /** |
||
| 23 | * RestActionAbstract constructor. |
||
| 24 | * |
||
| 25 | * @param RestRepository $repository |
||
| 26 | * @param RestResponseFactory $response |
||
| 27 | */ |
||
| 28 | 8 | public function __construct(RestRepository $repository, RestResponseFactory $response) |
|
| 29 | { |
||
| 30 | 8 | $this->repository = $repository; |
|
| 31 | 8 | $this->response = $response; |
|
| 32 | 8 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @param RestRequest $request |
||
| 36 | * |
||
| 37 | * @return RestResponse |
||
| 38 | */ |
||
| 39 | 8 | public function dispatch(RestRequest $request) |
|
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return RestRepository |
||
| 50 | */ |
||
| 51 | 8 | public function repository() |
|
| 52 | { |
||
| 53 | 8 | return $this->repository; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return RestResponseFactory |
||
| 58 | */ |
||
| 59 | 8 | public function response() |
|
| 62 | } |
||
| 63 | } |
||
| 64 |