1 | <?php |
||
20 | class Data extends Model |
||
21 | { |
||
22 | /** |
||
23 | * Parse a yaml file. |
||
24 | * |
||
25 | * @param string $yaml |
||
26 | * @param string $overrideYaml |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | 5 | public static function fromYaml($yaml, $overrideYaml): array |
|
43 | |||
44 | /** |
||
45 | * Replace placeholders with enviroment variables. |
||
46 | * |
||
47 | * Placeholders start with % and end with %. This will be replaced by the |
||
48 | * environment variable with the name SCHEMATIC_{PLACEHOLDER}. If the |
||
49 | * environment variable is not set an exception will be thrown. |
||
50 | * |
||
51 | * @param string $yaml |
||
52 | * |
||
53 | * @return string |
||
54 | * |
||
55 | * @throws Exception |
||
56 | */ |
||
57 | 5 | public static function replaceEnvVariables($yaml): string |
|
75 | |||
76 | /** |
||
77 | * Convert array to yaml. |
||
78 | * |
||
79 | * @param array $data |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | public static function toYaml(array $data): string |
|
87 | } |
||
88 |