| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public static function create( |
||
| 19 | Container $container, |
||
| 20 | string $basePath, |
||
| 21 | string $resourcesPath |
||
| 22 | ): Kernel { |
||
| 23 | $dotenv = new Dotenv($basePath); |
||
| 24 | $dotenv->load(); |
||
| 25 | |||
| 26 | $container->delegate(new ReflectionContainer); |
||
| 27 | |||
| 28 | $container->add('base_path', $basePath); |
||
| 29 | $container->add('resources_path', $resourcesPath); |
||
| 30 | |||
| 31 | // Load service providers |
||
| 32 | $container->addServiceProvider(new FilesystemServiceProvider(new Local($basePath))); |
||
| 33 | |||
| 34 | // Boot kernel |
||
| 35 | $kernel = new Kernel($container); |
||
| 36 | |||
| 37 | // Boot console application |
||
| 38 | $console = new Application('FondBot', \FondBot\Application\Kernel::VERSION); |
||
| 39 | $console->addCommands([ |
||
| 40 | new MakeIntent($kernel), |
||
| 41 | new MakeInteraction($kernel), |
||
| 42 | ]); |
||
| 43 | |||
| 44 | $container->add(Kernel::class, $kernel); |
||
| 45 | $container->add('console', $console); |
||
| 46 | |||
| 47 | return $kernel; |
||
| 48 | } |
||
| 49 | } |
||
| 50 |