Completed
Branch 2.0 (13ec26)
by Anton
05:17
created

ConsoleBootloader   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
9
namespace Spiral\Console\Bootloaders;
10
11
use Spiral\Boot\KernelInterface;
12
use Spiral\Console\CommandLocator;
13
use Spiral\Console\ConsoleCore;
14
use Spiral\Console\ConsoleDispatcher;
15
use Spiral\Console\LocatorInterface;
16
use Spiral\Core\Bootloaders\Bootloader;
17
18
class ConsoleBootloader extends Bootloader
19
{
20
    const BOOT = true;
21
22
    const SINGLETONS = [
23
        ConsoleCore::class      => ConsoleCore::class,
24
        LocatorInterface::class => CommandLocator::class
25
    ];
26
27
    /**
28
     * @param KernelInterface   $kernel
29
     * @param ConsoleDispatcher $console
30
     */
31
    public function boot(KernelInterface $kernel, ConsoleDispatcher $console)
32
    {
33
        $kernel->addDispatcher($console);
34
    }
35
}