daib17 /
forecast
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * Configuration file for DI container. |
||||
| 4 | */ |
||||
| 5 | return [ |
||||
| 6 | |||||
| 7 | // Services to add to the container. |
||||
| 8 | "services" => [ |
||||
| 9 | "content" => [ |
||||
| 10 | "shared" => true, |
||||
| 11 | "callback" => function () { |
||||
| 12 | $content = new \Anax\Content\FileBasedContent(); |
||||
| 13 | $content->setDI($this); |
||||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||||
| 14 | |||||
| 15 | // Load the configuration files |
||||
| 16 | $cfg = $this->get("configuration"); |
||||
| 17 | $config = $cfg->load("content.php"); |
||||
| 18 | $config = $config["config"] ?? null; |
||||
| 19 | $file = $config["file"] ?? null; |
||||
|
0 ignored issues
–
show
|
|||||
| 20 | |||||
| 21 | $content->configure($config); |
||||
|
0 ignored issues
–
show
It seems like
$config can also be of type null; however, parameter $config of Anax\Content\FileBasedContent::configure() does only seem to accept array, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 22 | |||||
| 23 | return $content; |
||||
| 24 | } |
||||
| 25 | ], |
||||
| 26 | ], |
||||
| 27 | ]; |
||||
| 28 |