| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | trait AppTrait |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Register the values into the container |
||
| 19 | * |
||
| 20 | * @return void |
||
| 21 | */ |
||
| 22 | private function registerApp() |
||
| 23 | { |
||
| 24 | $this->set(ConfigManager::class, function($c) { |
||
| 25 | return new ConfigManager($c->g(ConfigReader::class), $c->g(Translator::class)); |
||
| 26 | }); |
||
| 27 | // Jaxon App |
||
| 28 | $this->set(App::class, function($c) { |
||
| 29 | return new App($c->g(Jaxon::class), $c->g(ConfigManager::class), |
||
| 30 | $c->g(ResponseManager::class), $c->g(Translator::class)); |
||
| 31 | }); |
||
| 32 | // Jaxon App bootstrap |
||
| 33 | $this->set(Bootstrap::class, function($c) { |
||
| 34 | return new Bootstrap($c->g(ConfigManager::class), $c->g(PluginManager::class), $c->g(RequestHandler::class)); |
||
| 35 | }); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the App instance |
||
| 40 | * |
||
| 41 | * @return App |
||
| 42 | */ |
||
| 43 | public function getApp(): App |
||
| 44 | { |
||
| 45 | return $this->g(App::class); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Get the App bootstrap |
||
| 50 | * |
||
| 51 | * @return Bootstrap |
||
| 52 | */ |
||
| 53 | public function getBootstrap(): Bootstrap |
||
| 56 | } |
||
| 57 | } |
||
| 58 |