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

PropertyNotFoundException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 2.1481

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 8
loc 8
ccs 4
cts 6
cp 0.6667
rs 9.4285
cc 2
eloc 5
nc 2
nop 3
crap 2.1481
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