ForbiddenNames: Add missing reserved keywords to ForbiddenNames sniff by Nikschavan · Pull Request #923 · PHPCompatibility/PHPCompatibility

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops... and I forgot to mention in the issue that it would also be good if you could add some dummy code with valid use of the keywords to the https://github.com/PHPCompatibility/PHPCompatibility/blob/develop/PHPCompatibility/Tests/Keywords/ForbiddenNamesUnitTest.inc file.

That file basically tests that the sniff does not report false positives when the keyword is used correctly.

So for list, the example code could be:

list( $a, $b, $c ) = $array;

And for include, the example code could be:

include __DIR__ . '/path/to/file.php';
include( $file );

A small snippet of dummy code should be added for valid use of each of the added keywords.

Does that make sense ?