Completed
Push — master ( 3ebd9f...ed37c4 )
by Woody
02:43
created

ResponderException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 20
loc 20
ccs 6
cts 8
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A invalidClass() 12 12 2

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
namespace Equip\Exception;
4
5
use Equip\Adr\ResponderInterface;
6
use InvalidArgumentException;
7
8 View Code Duplication
class ResponderException extends InvalidArgumentException
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
     * @param string|object $spec
12
     *
13
     * @return static
14
     */
15 1
    public static function invalidClass($spec)
16
    {
17 1
        if (is_object($spec)) {
18
            $spec = get_class($spec);
19
        }
20
21 1
        return new static(sprintf(
22 1
            'Responder class `%s` must implement `%s`',
23 1
            $spec,
24
            ResponderInterface::class
25 1
        ));
26
    }
27
}
28