We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 14 | class Argument implements \ArrayAccess, \Countable |
||
| 15 | { |
||
| 16 | private $arguments = []; |
||
| 17 | |||
| 18 | 23 | public function __construct($arguments) |
|
| 19 | { |
||
| 20 | 23 | if (!is_array($arguments) && !$arguments instanceof \ArrayAccess) { |
|
| 21 | 5 | $arguments = [$arguments]; |
|
| 22 | 5 | } |
|
| 23 | 23 | $this->arguments = $arguments; |
|
|
|
|||
| 24 | 23 | } |
|
| 25 | |||
| 26 | public function offsetExists($offset) |
||
| 30 | |||
| 31 | public function offsetGet($offset) |
||
| 35 | |||
| 36 | public function offsetSet($offset, $value) |
||
| 40 | |||
| 41 | public function offsetUnset($offset) |
||
| 45 | |||
| 46 | public function __get($key) |
||
| 50 | |||
| 51 | public function __set($key, $value) |
||
| 55 | |||
| 56 | 6 | public function getRawArguments() |
|
| 60 | |||
| 61 | public function count() |
||
| 65 | } |
||
| 66 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountIdthat can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theidproperty of an instance of theAccountclass. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.