PropertyNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
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
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 4
    public function __construct($propertyName, $className = null, Exception $previous = null)
21
    {
22 4
        if ($className === null) {
23 1
            parent::__construct("Property '{$propertyName}' not found", 0, $previous);
24 1
        } else {
25 3
            parent::__construct("Property '{$propertyName}' not found on class '{$className}'", 0, $previous);
26
        }
27 4
    }
28
}
29