PropertyReadOnlyException   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 PropertyReadOnlyException
9
 * @package Marek\Toggable\Exception
10
 */
11
class PropertyReadOnlyException 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}' is readonly[ on class '{$className}'].
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 2
    public function __construct($propertyName, $className = null, Exception $previous = null)
21
    {
22 2
        if ($className === null) {
23 1
            parent::__construct("Property '{$propertyName}' is readonly", 0, $previous);
24 1
        } else {
25 1
            parent::__construct("Property '{$propertyName}' is readonly on class '{$className}'", 0, $previous);
26
        }
27 2
    }
28
}
29