Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | 2 | public function __invoke() : Config |
|
39 | { |
||
40 | 2 | if (is_file($this->cachedConfigFile)) { |
|
41 | 1 | return Config::fromArray(include $this->cachedConfigFile); |
|
42 | } |
||
43 | |||
44 | 2 | $configLoader = $this->configLoader; |
|
45 | /* @var $config Config */ |
||
46 | 2 | $config = $configLoader(); |
|
47 | |||
48 | 2 | file_put_contents($this->cachedConfigFile, '<?php return ' . var_export($config->toArray(), true) . ';'); |
|
49 | |||
50 | 2 | return $config; |
|
51 | } |
||
52 | } |
||
53 |