1 | <?php |
||
19 | abstract class AbstractTransformer implements TransformerInterface |
||
20 | { |
||
21 | /** |
||
22 | * The normalized includes |
||
23 | * |
||
24 | * @var null|array |
||
25 | */ |
||
26 | private $includes; |
||
27 | |||
28 | /** |
||
29 | * @param array $config |
||
30 | */ |
||
31 | public function __construct(array $config = []) |
||
35 | |||
36 | /** |
||
37 | * @return array |
||
38 | */ |
||
39 | protected function defineIncludes(): array |
||
43 | |||
44 | /** |
||
45 | * Returns an array of normalized includes. It is recommend |
||
46 | * @return array |
||
47 | */ |
||
48 | public function getIncludes(): array |
||
58 | |||
59 | /** |
||
60 | * @param mixed $data |
||
61 | * @param TransformerInterface|callable $transformer |
||
62 | * @return Item |
||
63 | */ |
||
64 | protected function item($data, $transformer): Item |
||
68 | |||
69 | /** |
||
70 | * @param mixed $data |
||
71 | * @param TransformerInterface|callable $transformer |
||
72 | * @return Collection |
||
73 | */ |
||
74 | protected function collection($data, $transformer): Collection |
||
78 | } |
||
79 |