1 | <?php |
||
14 | class DiscoveryFileLoader |
||
15 | { |
||
16 | /** |
||
17 | * Returns an array of array of asset operations indexed by asset type. |
||
18 | * |
||
19 | * @param \SplFileInfo $file |
||
20 | * @return AssetOperation[][] |
||
21 | * @throws JsonException |
||
22 | */ |
||
23 | public function loadDiscoveryFile(\SplFileInfo $file, string $package, string $packageDir) : array |
||
48 | |||
49 | /** |
||
50 | * Returns false if the array is numerically indexed, starting at 0. |
||
51 | * |
||
52 | * @param array $arr |
||
53 | * @return bool |
||
54 | */ |
||
55 | private function isAssoc(array $arr) |
||
62 | |||
63 | /** |
||
64 | * Returns the contents of the file. |
||
65 | * |
||
66 | * @param \SplFileInfo $file |
||
67 | * @return string the contents of the file |
||
68 | * |
||
69 | */ |
||
70 | private function getContents(\SplFileInfo $file) |
||
81 | |||
82 | /** |
||
83 | * Transforms a value string into a value array. |
||
84 | * Also, if a value array is passed, checks it contains valid data. |
||
85 | * |
||
86 | * @param mixed $value |
||
87 | * @return AssetOperation |
||
88 | */ |
||
89 | private function toAssetOperation($value, string $package, string $packageDir) : AssetOperation |
||
97 | } |
||
98 |