Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public function setParameterValue(mixed $newValue): void |
||
40 | { |
||
41 | if (!$this->allowTypeChange) { |
||
42 | $currentType = \gettype($this->parameter); |
||
43 | $newType = \gettype($newValue); |
||
44 | if ($newType !== $currentType) { |
||
45 | throw new PhpfastcacheInvalidTypeException( |
||
46 | \sprintf('You tried to change the variable type from "%s" to "%s" which is not allowed.', $currentType, $newType) |
||
47 | ); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | $this->parameter = $newValue; |
||
52 | } |
||
59 |