Issues (13)

config/di/curl.php (1 issue)

1
<?php
2
/**
3
 * Configuration file for request service.
4
 */
5
return [
6
    // Services to add to the container.
7
    "services" => [
8
        "curl" => [
9
            "shared" => true,
10
            "callback" => function () {
11
                $curl = new \Jodn14\Curl\Curl();
12
13
                //Load 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("curl");
16
17
                //Set API Keys
18
                $weatherKey = $config["config"]["weatherKey"] ?? null;
19
                $ipstackKey = $config["config"]["ipstackKey"] ?? null;
20
                $mapquestKey = $config["config"]["mapquestKey"] ?? null;
21
                if (is_string($weatherKey)) {
22
                    $curl->setKeys($weatherKey, $ipstackKey, $mapquestKey);
23
                }
24
                return $curl;
25
            }
26
        ],
27
    ],
28
];
29