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.

DebugTrait::doThrow()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 2
1
<?php
2
/**
3
 * Novactive Collection.
4
 *
5
 * @author    Luke Visinoni <[email protected], [email protected]>
6
 * @author    Sébastien Morel <[email protected], [email protected]>
7
 * @copyright 2017 Novactive
8
 * @license   MIT
9
 */
10
11
namespace Novactive\Collection\Debug;
12
13
/**
14
 * Trait DebugTrait.
15
 */
16
trait DebugTrait
17
{
18
    /**
19
     * {@inheritdoc}
20
     *
21
     * @codeCoverageIgnore
22
     *
23
     * @see \Novactive\Collection\Collection::doThrow
24
     */
25
    protected function doThrow($message, $arguments)
26
    {
27
        if (!getenv('UNIT_TESTS')) {
28
            ob_start();
29
            dump($this->items);
0 ignored issues
show
Bug introduced by
The property items does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
Bug introduced by
The call to dump() misses a required argument $valid.

This check looks for function calls that miss required arguments.

Loading history...
30
            dump($arguments);
0 ignored issues
show
Bug introduced by
The call to dump() misses a required argument $valid.

This check looks for function calls that miss required arguments.

Loading history...
31
            $output = ob_get_contents();
32
            ob_flush();
33
            $message .= PHP_EOL.$output;
34
        }
35
        parent::doThrow($message, $arguments);
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     *
41
     * @codeCoverageIgnore
42
     *
43
     * @see \Novactive\Collection\Collection::dump
44
     */
45
    public function dump()
46
    {
47
        if (!getenv('UNIT_TESTS')) {
48
            dump($this->items);
0 ignored issues
show
Bug introduced by
The call to dump() misses a required argument $valid.

This check looks for function calls that miss required arguments.

Loading history...
49
        }
50
51
        return parent::dump();
52
    }
53
}
54