danbettles /
gestalt
| 1 | <?php |
||
| 2 | |||
| 3 | namespace DanBettles\Gestalt\Tests; |
||
| 4 | |||
| 5 | use DanBettles\Gestalt\ArrayObject; |
||
| 6 | |||
| 7 | require_once __DIR__ . '/../../vendor/autoload.php'; |
||
| 8 | |||
| 9 | $elements = [ |
||
| 10 | 'foo' => 'bar', |
||
| 11 | 'baz' => 'qux', |
||
| 12 | 'quux' => 'quuz', |
||
| 13 | ]; |
||
| 14 | |||
| 15 | $output = []; |
||
| 16 | |||
| 17 | $arrayObject = (new ArrayObject($elements))->each(function ($key, $value) use (&$output) { |
||
|
0 ignored issues
–
show
|
|||
| 18 | $output[$key] = $value; |
||
| 19 | }); |
||
| 20 | |||
| 21 | \assert($output === $elements); |
||
| 22 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.