Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.1967 |
Changes | 0 |
1 | <?php |
||
33 | 2 | public function configure($what) |
|
34 | { |
||
35 | 2 | $anaxInstallPath = ANAX_INSTALL_PATH . "/config/$what"; |
|
36 | 2 | $anaxAppPath = ANAX_APP_PATH . "/config/$what"; |
|
37 | |||
38 | 2 | if (is_array($what)) { |
|
39 | $options = $what; |
||
40 | 2 | } elseif (is_readable($anaxAppPath)) { |
|
41 | $options = require $anaxAppPath; |
||
42 | 2 | } elseif (is_readable($anaxInstallPath)) { |
|
43 | 2 | $options = require $anaxInstallPath; |
|
44 | 2 | } else { |
|
45 | throw new Exception("Configure item '$what' is not an array nor a readable file."); |
||
46 | } |
||
47 | |||
48 | 2 | $this->config = array_merge($this->config, $options); |
|
49 | 2 | return $this->config; |
|
50 | } |
||
51 | } |
||
52 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.