Conditions | 6 |
Paths | 8 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 14 |
Ratio | 56 % |
Tests | 15 |
CRAP Score | 6.0585 |
Changes | 0 |
1 | <?php |
||
30 | 4 | public function configure($what) |
|
31 | { |
||
32 | 4 | if (is_array($what)) { |
|
33 | 2 | $this->config = $what; |
|
34 | 2 | return $this; |
|
35 | } |
||
36 | |||
37 | 2 | View Code Duplication | if (defined("ANAX_APP_PATH")) { |
38 | 2 | $path = ANAX_APP_PATH . "/config/$what"; |
|
39 | 2 | if (is_readable($path)) { |
|
40 | 1 | $this->config = require $path; |
|
41 | 1 | return $this; |
|
42 | } |
||
43 | 1 | } |
|
44 | |||
45 | 1 | View Code Duplication | if (defined("ANAX_INSTALL_PATH")) { |
46 | 1 | $path = ANAX_INSTALL_PATH . "/config/$what"; |
|
47 | 1 | if (is_readable($path)) { |
|
48 | $this->config = require $path; |
||
49 | return $this; |
||
50 | } |
||
51 | 1 | } |
|
52 | |||
53 | 1 | throw new Exception("Configure item '$what' is not an array nor a readable file."); |
|
54 | } |
||
55 | |||
73 |
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.