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

ApplicationServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A boot() 0 8 2
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