| 1 | <?php |
||
| 7 | trait ImmutableTrait |
||
| 8 | { |
||
| 9 | /** @var bool $constructed */ |
||
| 10 | private $constructed = false; |
||
| 11 | |||
| 12 | |||
| 13 | /** |
||
| 14 | * ImmutableTrait constructor. |
||
| 15 | * |
||
| 16 | * @throws ImmutableException |
||
| 17 | */ |
||
| 18 | 8 | public function setConstructed() |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Disable the magic function to prevent change the immutable object |
||
| 28 | * |
||
| 29 | * @param string $name |
||
| 30 | * @param string $value |
||
| 31 | */ |
||
| 32 | 2 | final public function __set($name, $value) |
|
| 36 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.