1 | <?php |
||
19 | class TransformerHelper |
||
20 | { |
||
21 | /** |
||
22 | * @param $transformer |
||
23 | * @return bool |
||
24 | */ |
||
25 | 3 | public static function isTransformer($transformer): bool |
|
30 | |||
31 | /** |
||
32 | * @param $transformer |
||
33 | * @return bool |
||
34 | */ |
||
35 | public static function isTransformerClass($transformer): bool |
||
39 | |||
40 | /** |
||
41 | * @param $transformer |
||
42 | * @return null|callable|TransformerInterface |
||
43 | */ |
||
44 | public static function resolve($transformer) |
||
56 | |||
57 | /** |
||
58 | * @param TransformerInterface $transformer |
||
59 | * @param string $key |
||
60 | * @return bool |
||
61 | */ |
||
62 | public static function inInclude(TransformerInterface $transformer, string $key): bool |
||
66 | |||
67 | /** |
||
68 | * @param array $includes |
||
69 | * @return array |
||
70 | */ |
||
71 | public static function normalizeIncludes(array $includes): array |
||
102 | |||
103 | /** |
||
104 | * Retrieves the value of an array element or object property with the given key or property name. |
||
105 | * |
||
106 | * @param $array |
||
107 | * @param $key |
||
108 | * @param null $default |
||
109 | * @return mixed|null |
||
110 | */ |
||
111 | private static function findInArray(array $array, string $key, $default = null) |
||
120 | } |
||
121 |