Test Failed
Push — stable ( 1dab66...3c4cff )
by Nuno
03:33
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 2
lcom 1
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 6 1
1
<?php
2
3
namespace LaravelZero\Framework\Providers\ErrorHandler;
4
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
use LaravelZero\Framework\Contracts\Providers\ErrorHandler as ErrorHandlerContract;
7
8
/**
9
 * This is the Zero Framework composer service provider class.
10
 *
11
 * @author Nuno Maduro <[email protected]>
12
 */
13
class ServiceProvider extends BaseServiceProvider
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function boot(ErrorHandlerContract $errorHandler): void
19
    {
20
        $errorHandler->register();
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function register(): void
27
    {
28
        $this->app->singleton(ErrorHandlerContract::class, function () {
29
            return new ErrorHandler;
30
        });
31
    }
32
}
33