Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
22 | 22 | protected function doLoad(string $file) : void |
|
23 | { |
||
24 | 22 | $contents = file_get_contents($file); |
|
25 | |||
26 | 22 | assert($contents !== false); |
|
27 | |||
28 | 22 | $config = json_decode($contents, true); |
|
29 | |||
30 | 22 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
31 | 1 | throw JsonNotValid::new(); |
|
32 | } |
||
33 | |||
34 | 21 | if (isset($config['migrations_directory'])) { |
|
35 | 14 | $config['migrations_directory'] = $this->getDirectoryRelativeToFile( |
|
36 | 14 | $file, |
|
37 | 14 | $config['migrations_directory'] |
|
38 | ); |
||
39 | } |
||
40 | |||
41 | 21 | $this->setConfiguration($config); |
|
42 | 18 | } |
|
44 |