Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables

File /core/tests/Drupal/Tests/Core/Database/EmptyStatementTest.php

Line 42: Unused local variable $record

Comments

chertzog’s picture

Status: Active » Closed (duplicate)
angel.h’s picture

Status: Closed (duplicate) » Active

This issue shouldn't have been closed - see https://drupal.org/node/2080311#comment-7909573.

mcrittenden’s picture

Status: Active » Closed (won't fix)

IMO this should be a won't fix because even though it creates an unused variable, it's the cleanest and most readable to test if something is iterable. From SO, the alternative looks like this:

$is_iterable = is_array($var) || $var instanceof Traversable;

I'd rather just stick with what which is instantly understandable.