Conditions | 6 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
41 | 19 | protected function loadData($file) |
|
42 | { |
||
43 | 19 | if ($file === false || $file === null) { |
|
44 | 1 | return []; |
|
45 | } |
||
46 | |||
47 | 18 | if (basename($file) === $file && $this->dataDirectory !== null) { |
|
48 | 4 | $file = $this->dataDirectory . '/' . $file; |
|
49 | } |
||
50 | |||
51 | 18 | $file = Yii::getAlias($file); |
|
52 | 18 | if (is_file($file)) { |
|
53 | 17 | return require $file; |
|
54 | } |
||
55 | |||
56 | 1 | throw new InvalidConfigException("Fixture data file does not exist: {$file}"); |
|
57 | } |
||
58 | |||
60 |