Completed
Push — master ( 816440...cac82f )
by Vladimir
12:37
created

Application::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 5
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Framework;
6
7
use FondBot\Foundation\Kernel;
8
use FondBot\Framework\Http\Kernel as HttpKernel;
9
use FondBot\Framework\Console\Kernel as ConsoleKernel;
10
use Illuminate\Foundation\Application as BaseApplication;
11
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
12
use FondBot\Framework\Exceptions\Handler as ExceptionsHandler;
13
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
14
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerContract;
15
16
class Application extends BaseApplication
17
{
18
    public function __construct($basePath = null)
19
    {
20
        parent::__construct($basePath);
21
22
        $this->configure();
23
    }
24
25
    /** {@inheritdoc} */
26
    public function version(): string
27
    {
28
        return Kernel::VERSION;
29
    }
30
31
    /** {@inheritdoc} */
32
    public function configPath($path = ''): string
33
    {
34
        return $this->basePath('vendor/fondbot/framework/config');
35
    }
36
37
    private function configure(): void
38
    {
39
        $this->singleton(HttpKernelContract::class, HttpKernel::class);
40
        $this->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
41
        $this->singleton(ExceptionHandlerContract::class, ExceptionsHandler::class);
42
    }
43
}
44