1 | <?php |
||
22 | abstract class AbstractResource implements ResourceInterface |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var Scope |
||
27 | */ |
||
28 | protected $scope; |
||
29 | |||
30 | /** |
||
31 | * @param callable $transformer |
||
32 | * @param $data |
||
33 | * @return null|array |
||
34 | */ |
||
35 | public abstract function transform(callable $transformer, $data); |
||
36 | |||
37 | /** |
||
38 | * @param Scope $scope |
||
39 | * @param array $config |
||
40 | */ |
||
41 | public function __construct(Scope $scope, array $config = []) |
||
46 | |||
47 | /** |
||
48 | * @return ParamBag |
||
49 | */ |
||
50 | protected function getParams(): ParamBag |
||
54 | |||
55 | /** |
||
56 | * @param $data |
||
57 | * @param callable $transformer |
||
58 | * @return array|null |
||
59 | */ |
||
60 | public function __invoke($data, callable $transformer) |
||
67 | |||
68 | } |
||
69 |