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 ( b4b6cb...9f2353 )
by SignpostMarv
05:37
created

AbstractPropertyNotThingableException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 100 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 27
loc 27
c 0
b 0
f 0
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 16 16 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
* Exceptions.
4
*
5
* @author SignpostMarv
6
*/
7
declare(strict_types=1);
8
9
namespace SignpostMarv\DaftObject;
10
11
use Exception;
12
use Throwable;
13
14
/**
15
* Error thrown when a property is not thingable.
16
*/
17 View Code Duplication
abstract class AbstractPropertyNotThingableException extends Exception
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...
18
{
19
    /**
20
    * Wraps to Exception::__construct().
21
    *
22
    * @param string $thing the type of thing that the $property cannot do, i.e. writeable, nullable
23
    * @param string $className name of the class on which the property is not thingable
24
    * @param string $property name of the property which is not thingable
25
    * @param int $code @see Exception::__construct()
26
    * @param Throwable|null $previous @see Exception::__construct()
27
    */
28 5
    public function __construct(
29
        string $thing,
30
        string $className,
31
        string $property,
32
        int $code = 0,
33
        Throwable $previous = null
34
    ) {
35 5
        parent::__construct(
36 5
            sprintf(
37 5
                'Property not %s: %s::$%s',
38 5
                $thing,
39 5
                $className,
40 5
                $property
41
            ),
42 5
            $code,
43 5
            $previous
44
        );
45 5
    }
46
}
47