Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 87.5% |
Changes | 0 |
1 | <?php namespace Pz\Doctrine\Rest\Fractal; |
||
5 | class JsonApiSerializer extends \League\Fractal\Serializer\JsonApiSerializer |
||
6 | { |
||
7 | /** |
||
8 | * @var RestRequestContract |
||
9 | */ |
||
10 | protected $request; |
||
11 | |||
12 | /** |
||
13 | * JsonApiSerializer constructor. |
||
14 | * |
||
15 | * @param RestRequestContract $request |
||
16 | */ |
||
17 | 18 | public function __construct(RestRequestContract $request) |
|
18 | { |
||
19 | 18 | parent::__construct($request->getBaseUrl()); |
|
20 | 18 | $this->request = $request; |
|
21 | 18 | } |
|
22 | |||
23 | /** |
||
24 | * @return RestRequestContract |
||
25 | */ |
||
26 | public function request() |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param string $resourceKey |
||
33 | * @param array $data |
||
34 | * @param bool $includeAttributes |
||
35 | * |
||
36 | * @return array |
||
37 | */ |
||
38 | 12 | public function collection($resourceKey, array $data, $includeAttributes = true) |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param string $resourceKey |
||
51 | * @param array $data |
||
52 | * @param bool $includeAttributes |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | 17 | public function item($resourceKey, array $data, $includeAttributes = true) |
|
66 |