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