| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | trait ImmutableArrayHelperMethods |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * Prevent implicit setting of properties |
||
| 27 | * |
||
| 28 | * @see http://php.net/manual/en/arrayaccess.offsetset.php |
||
| 29 | * |
||
| 30 | * @param string $property - Property name to set |
||
| 31 | * @param mixed $value - Mixed value to set property to |
||
| 32 | * @return void |
||
| 33 | * @throws ImmutableMethodCallException - Always throws an exception |
||
| 34 | */ |
||
| 35 | 1 | final public function offsetSet($property, $value) |
|
| 36 | { |
||
| 37 | 1 | throw new ImmutableMethodCallException; |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Prevent implicit unsetting of properties |
||
| 42 | * |
||
| 43 | * @see http://php.net/manual/en/arrayaccess.offsetunset.php |
||
| 44 | * |
||
| 45 | * @param string $property - Property name to unset |
||
| 46 | * @return void |
||
| 47 | * @throws ImmutableMethodCallException - Always throws an exception |
||
| 48 | */ |
||
| 49 | 1 | final public function offsetUnset($property) |
|
| 52 | } |
||
| 53 | } |
||
| 54 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.