| Conditions | 4 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 3 | public function getConfiguration() : Configuration |
|
| 29 | { |
||
| 30 | 3 | if ($this->file !== null) { |
|
| 31 | 1 | return $this->loadConfiguration($this->file); |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * If no config has been provided, look for default config file in the path. |
||
| 36 | */ |
||
| 37 | $defaultFiles = [ |
||
| 38 | 2 | 'migrations.xml', |
|
| 39 | 'migrations.yml', |
||
| 40 | 'migrations.yaml', |
||
| 41 | 'migrations.json', |
||
| 42 | 'migrations.php', |
||
| 43 | ]; |
||
| 44 | |||
| 45 | 2 | foreach ($defaultFiles as $file) { |
|
| 46 | 2 | if ($this->configurationFileExists($file)) { |
|
| 47 | 1 | return $this->loadConfiguration($file); |
|
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | 1 | throw MissingConfigurationFile::new(); |
|
| 52 | } |
||
| 67 |