anonymous()
last analyzed

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 16
c 0
b 0
f 0
nc 2
nop 0
1
<?php
2
/**
3
 * Configuration file for DI container.
4
 */
5
return [
6
    "services" => [
7
        "remserver" => [
8
            "shared" => true,
9
            "callback" => function () {
10
                $rem = new \Anax\RemServer\RemServer();
11
                $rem->injectSession($this->get("session"));
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
12
13
                // Load the configuration file
14
                $cfg = $this->get("configuration");
15
                $config = $cfg->load("remserver/config.php");
16
                $configFile = $config["file"] ?? null;
17
18
                $dataset = $config["config"]["dataset"] ?? null;
19
                if (!$dataset) {
20
                    throw new Exception("Configuration file '$configFile' is missing an entry 'dataset'.");
21
                }
22
23
                $rem->setDefaultDataset($dataset);
24
                return $rem;
25
            }
26
        ],
27
    ],
28
];
29