| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Application |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var Container |
||
| 12 | */ |
||
| 13 | private $container; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return $this |
||
| 17 | */ |
||
| 18 | private static $instance; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @return $this |
||
| 22 | */ |
||
| 23 | public static function make() |
||
| 24 | { |
||
| 25 | if (null === self::$instance) { |
||
| 26 | self::$instance = new Application(); |
||
| 27 | } |
||
| 28 | return self::$instance; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * |
||
| 33 | * @return $this |
||
| 34 | */ |
||
| 35 | public function configure() |
||
| 36 | { |
||
| 37 | $this->container = new Container(); |
||
| 38 | |||
| 39 | $this->container->add('debug', env('APP_DEBUG')); |
||
| 40 | |||
| 41 | $this->container->add(Controller::class, function() { |
||
| 42 | return new Controller($this->container); |
||
| 43 | }); |
||
| 44 | |||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function process() |
||
| 49 | { |
||
| 50 | |||
| 51 | return $this; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function end() |
||
| 57 | } |
||
| 58 | } |
||
| 59 |