Completed
Push — master ( 17312a...d17d72 )
by Mario
03:12
created

PropertyNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 18
loc 18
ccs 4
cts 6
cp 0.6667
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 8 8 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 Marek\Toggable\API\Exception;
4
5
use Exception;
6
7
/**
8
 * Class PropertyNotFoundException
9
 * @package Marek\Toggable\Exception
10
 */
11 View Code Duplication
class PropertyNotFoundException 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...
12
{
13
    /**
14
     * Generates: Property '{$propertyName}' not found.
15
     *
16
     * @param string $propertyName
17
     * @param string|null $className Optionally to specify class in abstract/parent classes
18
     * @param \Exception|null $previous
19
     */
20 1
    public function __construct($propertyName, $className = null, Exception $previous = null)
21
    {
22 1
        if ($className === null) {
23
            parent::__construct("Property '{$propertyName}' not found", 0, $previous);
24
        } else {
25 1
            parent::__construct("Property '{$propertyName}' not found on class '{$className}'", 0, $previous);
26
        }
27 1
    }
28
}
29