Issues (47)

config/di/db.php (1 issue)

1
<?php
2
/**
3
 * Configuration file for database service.
4
 */
5
return [
6
    // Services to add to the container.
7
    "services" => [
8
        "db" => [
9
            "shared" => true,
10
            "callback" => function () {
11
                $db = new \Anax\Database\Database();
12
13
                // Load the configuration files
14
                $cfg = $this->get("configuration");
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
15
                $config = $cfg->load("database");
16
17
                // Set the database configuration
18
                $connection = $config["config"] ?? [];
19
                $db->setOptions($connection);
20
21
                return $db;
22
            }
23
        ],
24
    ],
25
];
26