| 1 | <?php |
||
| 20 | abstract class AbstractResource implements ResourceInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var Scope |
||
| 24 | */ |
||
| 25 | protected $scope; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param callable $transformer |
||
| 29 | * @param $data |
||
| 30 | * @return null|array |
||
| 31 | */ |
||
| 32 | abstract public function transform(callable $transformer, $data); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param Scope $scope |
||
| 36 | * @param array $config |
||
| 37 | */ |
||
| 38 | public function __construct(Scope $scope, array $config = []) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return ParamBag |
||
| 46 | */ |
||
| 47 | protected function getParams(): ParamBag |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param $data |
||
| 54 | * @param callable $transformer |
||
| 55 | * @return array|null |
||
| 56 | */ |
||
| 57 | public function __invoke($data, callable $transformer) |
||
| 64 | } |
||
| 65 |