Completed
Push — master ( f0be6a...8065a1 )
by Albert
03:44
created

WhoopsServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Albert221\Blog\ServiceProvider;
4
5
use League\Container\ServiceProvider\AbstractServiceProvider;
6
use League\Container\ServiceProvider\BootableServiceProviderInterface;
7
use Whoops\Handler\PrettyPageHandler;
8
use Whoops\Run;
9
10
class WhoopsServiceProvider extends AbstractServiceProvider implements BootableServiceProviderInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function boot()
16
    {
17
        (new Run)->pushHandler(new PrettyPageHandler)->register();
1 ignored issue
show
Documentation introduced by
new \Whoops\Handler\PrettyPageHandler() is of type object<Whoops\Handler\PrettyPageHandler>, but the function expects a callable.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function register()
24
    {
25
        //
26
    }
27
}
28