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

ServiceProvider::boot()   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
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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