GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DebugErrorReporter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 2
Metric Value
c 4
b 1
f 2
dl 0
loc 34
wmc 3
lcom 1
cbo 2
ccs 15
cts 15
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A reportError() 0 15 2
1
<?php
2
3
namespace Camspiers\LoggerBridge\ErrorReporter;
4
5
use Camspiers\LoggerBridge\EnvReporter\EnvReporter;
6
use Debug;
7
8
/**
9
 * Class DebugErrorReporter
10
 */
11
class DebugErrorReporter implements ErrorReporter
12
{
13
    /**
14
     * @var \Camspiers\LoggerBridge\EnvReporter\EnvReporter
15
     */
16
    protected $envReporter;
17
    /**
18
     * @param \Camspiers\LoggerBridge\EnvReporter\EnvReporter $envReporter
19
     */
20 3
    public function __construct(EnvReporter $envReporter)
21
    {
22 3
        $this->envReporter = $envReporter;
23 3
    }
24
25
    /**
26
     * @param \Exception      $exception
27
     * @param \SS_HTTPRequest $request
28
     */
29 2
    public function reportError(\Exception $exception, \SS_HTTPRequest $request = null)
30
    {
31 2
        if (!$this->envReporter->isLive()) {
32 1
            Debug::showError(
33 1
                $exception->getCode(),
34 1
                $exception->getMessage(),
0 ignored issues
show
Documentation introduced by
$exception->getMessage() is of type string, but the function expects a object<unknown_type>.

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...
35 1
                $exception->getFile(),
0 ignored issues
show
Documentation introduced by
$exception->getFile() is of type string, but the function expects a object<unknown_type>.

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...
36 1
                $exception->getLine(),
0 ignored issues
show
Documentation introduced by
$exception->getLine() is of type integer, but the function expects a object<unknown_type>.

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...
37 1
                false,
0 ignored issues
show
Documentation introduced by
false is of type boolean, but the function expects a object<unknown_type>.

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...
38
                'Error'
39 1
            );
40 1
        } else {
41 1
            Debug::friendlyError();
42
        }
43 2
    }
44
}
45