1 | <?php |
||
2 | /** |
||
3 | * Configuration file for DI container. |
||
4 | */ |
||
5 | return [ |
||
6 | |||
7 | // Services to add to the container. |
||
8 | "services" => [ |
||
9 | "ipverify" => [ |
||
10 | // Is the service shared, true or false |
||
11 | // Optional, default is true |
||
12 | "shared" => true, |
||
13 | |||
14 | // Callback executed when service is activated |
||
15 | // Create the service, load its configuration (if any) |
||
16 | // and set it up. |
||
17 | "callback" => function () { |
||
18 | $cfg = $this->get("configuration"); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
19 | $config = $cfg->load("api.php"); |
||
20 | $res = new \Anax\Model\IpValidator($config["config"]["ipstack"]["key"]); |
||
21 | return $res; |
||
22 | } |
||
23 | ], |
||
24 | ], |
||
25 | ]; |
||
26 |