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.
Completed
Push — master ( b45687...2691f8 )
by Pascal
01:21
created

CheckerIsStillFailing::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Pbmedia\ApiHealth\Events;
4
5
use Pbmedia\ApiHealth\Checkers\Checker;
6
use Pbmedia\ApiHealth\Checkers\CheckerHasFailed;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, Pbmedia\ApiHealth\Events\CheckerHasFailed.

Let’s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let’s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
7
8 View Code Duplication
class CheckerIsStillFailing extends CheckerHasFailed
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * The checker.
12
     *
13
     * @var \Pbmedia\ApiHealth\Checkers\Checker
14
     */
15
    public $checker;
16
17
    /**
18
     * The exception.
19
     *
20
     * @var \Pbmedia\ApiHealth\Checkers\CheckerHasFailed
21
     */
22
    public $exception;
23
24
    /**
25
     * The failed data.
26
     *
27
     * @var array
28
     */
29
    public $failedData;
30
31
    /**
32
     * Creates a new instance of this event.
33
     *
34
     * @param Pbmedia\ApiHealth\Checkers\Checker  $checker
35
     * @param \Pbmedia\ApiHealth\Checkers\CheckerHasFailed  $exception
36
     * @param array  $failedData
37
     */
38
    public function __construct(Checker $checker, CheckerHasFailed $exception, array $failedData)
39
    {
40
        $this->checker    = $checker;
41
        $this->exception  = $exception;
42
        $this->failedData = $failedData;
43
    }
44
}
45