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.
Loading history...
13
*/
14
private $config = [];
15
16
17
18
/**
19
* Read configuration from file or array, if a file, first check in
20
* ANAX_APP_PATH/config and then in ANAX_INSTALL_PATH/config.
21
*
22
* @param array|string $what is an array with key/value config options
23
* or a file to be included which returns such
24
* an array.
25
*
26
* @throws Exception when argument if not a file nor an array.
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
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
56
57
58
/**
59
* Helper function for reading values from the configuration.
60
*
61
* @param string $key matching a key in the config array.
62
* @param string $default value returned when config item is not found.
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.