1 | <?php |
||
20 | class TransformerHelper |
||
21 | { |
||
22 | /** |
||
23 | * @param $transformer |
||
24 | * @return bool |
||
25 | */ |
||
26 | 3 | public static function isTransformer($transformer): bool |
|
31 | |||
32 | /** |
||
33 | * @param $transformer |
||
34 | * @return bool |
||
35 | */ |
||
36 | public static function isTransformerClass($transformer): bool |
||
44 | |||
45 | /** |
||
46 | * @param $transformer |
||
47 | * @return null|callable|TransformerInterface |
||
48 | */ |
||
49 | public static function resolve($transformer) |
||
61 | |||
62 | /** |
||
63 | * @param TransformerIncludesInterface $transformer |
||
64 | * @param string $key |
||
65 | * @return bool |
||
66 | */ |
||
67 | public static function inInclude(TransformerIncludesInterface $transformer, string $key): bool |
||
71 | |||
72 | /** |
||
73 | * @param array $includes |
||
74 | * @return array |
||
75 | */ |
||
76 | public static function normalizeIncludes(array $includes): array |
||
107 | |||
108 | /** |
||
109 | * Retrieves the value of an array element or object property with the given key or property name. |
||
110 | * |
||
111 | * @param $array |
||
112 | * @param $key |
||
113 | * @param null $default |
||
114 | * @return mixed|null |
||
115 | */ |
||
116 | private static function findInArray(array $array, string $key, $default = null) |
||
125 | } |
||
126 |