Total Complexity | 6 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class InvalidPropertyRangeSetException extends UnexpectedValueException implements ExceptionInterface |
||
15 | { |
||
16 | |||
17 | private $propertyName; |
||
18 | |||
19 | private $propertyFile; |
||
20 | |||
21 | private $rangeSet; |
||
22 | |||
23 | public function __construct(string $propertyName, string $propertyFile, $rangeSet, Throwable $previous = null) |
||
24 | { |
||
25 | $this->propertyName = $propertyName; |
||
26 | $this->propertyFile = $propertyFile; |
||
27 | $this->rangeSet = $rangeSet; |
||
28 | parent::__construct($this->buildMessage(), 0, $previous); |
||
29 | } |
||
30 | |||
31 | private function buildMessage(): string |
||
32 | { |
||
33 | $actualType = is_object($this->rangeSet) |
||
34 | ? get_class($this->rangeSet) |
||
35 | : gettype($this->rangeSet); |
||
36 | $expectedType = RangeSet::class; |
||
37 | |||
38 | return |
||
39 | "Invalid range set loaded from {$this->propertyFile} for Unicode property '{$this->propertyName}':\n" . |
||
40 | "{$actualType} instead of {$expectedType}"; |
||
41 | } |
||
42 | |||
43 | public function getPropertyName(): string |
||
46 | } |
||
47 | |||
48 | public function getPropertyFile(): string |
||
49 | { |
||
50 | return $this->propertyFile; |
||
51 | } |
||
52 | |||
53 | public function getRangeSet() |
||
56 | } |
||
57 | } |
||
58 |