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

ApplicationServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
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