| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait ConfigTrait |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Register the values into the container |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | private function registerConfigs() |
||
| 16 | { |
||
| 17 | $this->set(Config::class, function($c) { |
||
| 18 | return new Config($c->g('jaxon.core.options')); |
||
| 19 | }); |
||
| 20 | $this->set(Reader::class, function($c) { |
||
| 21 | return new Reader($c->g(Config::class)); |
||
| 22 | }); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get the config manager |
||
| 27 | * |
||
| 28 | * @return Config |
||
| 29 | */ |
||
| 30 | public function getConfig() |
||
| 31 | { |
||
| 32 | return $this->g(Config::class); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get the config reader |
||
| 37 | * |
||
| 38 | * @return Reader |
||
| 39 | */ |
||
| 40 | public function getConfigReader() |
||
| 41 | { |
||
| 42 | return $this->g(Reader::class); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Create a new the config manager |
||
| 47 | * |
||
| 48 | * @param array $aOptions The options array |
||
| 49 | * @param string $sKeys The keys of the options in the array |
||
| 50 | * |
||
| 51 | * @return Config The config manager |
||
| 52 | */ |
||
| 53 | public function newConfig(array $aOptions = [], $sKeys = '') |
||
| 56 | } |
||
| 57 | } |
||
| 58 |