Completed
Push — master ( 283542...d399c1 )
by Changwan
03:04
created

ApplicationServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace WanduSkeleton;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProviderInterface;
6
use Wandu\Foundation\Contracts\HttpErrorHandlerInterface;
7
use Wandu\Foundation\Contracts\KernelInterface;
8
use Wandu\Foundation\Error\DefaultHttpErrorHandler;
9
10
class ApplicationServiceProvider implements ServiceProviderInterface
11
{
12
    public function register(ContainerInterface $app)
13
    {
14
        $app->bind(HttpErrorHandlerInterface::class, DefaultHttpErrorHandler::class);
15
    }
16
17
    public function boot(ContainerInterface $app)
18
    {
19
        if ($app->has(KernelInterface::class)) {
20
            $kernel = $app->get(KernelInterface::class);
21
            $kernel['commands'] = require __DIR__ . '/../app/commands.php';
22
            $kernel['routes'] = require __DIR__ . '/../app/routes.php';
23
        }
24
    }
25
}
26