1 | <?php |
||
20 | class Data extends Model |
||
21 | { |
||
22 | /** |
||
23 | * Replace placeholders with enviroment variables. |
||
24 | * |
||
25 | * Placeholders start with % and end with %. This will be replaced by the |
||
26 | * environment variable with the name SCHEMATIC_{PLACEHOLDER}. If the |
||
27 | * environment variable is not set an exception will be thrown. |
||
28 | * |
||
29 | * @param string $yaml |
||
30 | * |
||
31 | * @return string |
||
32 | * |
||
33 | * @throws Exception |
||
34 | */ |
||
35 | 9 | public static function replaceEnvVariables($yaml): string |
|
57 | |||
58 | /** |
||
59 | * Convert array to yaml. |
||
60 | * |
||
61 | * @param array $data |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 3 | public static function toYaml(array $data): string |
|
69 | |||
70 | /** |
||
71 | * Read yaml file and parse content. |
||
72 | * |
||
73 | * @param $file |
||
74 | * @return array |
||
75 | * @throws Exception |
||
76 | */ |
||
77 | 9 | public static function parseYamlFile($file): array |
|
89 | } |
||
90 |