7.0.8: PHP 7.0 Sniffs - update 2016-10-31 - Spooky !
PHP 7.0 Sniffs - update 2016-10-31 - Spooky !
See all related issues and PRs in the 7.0.8 milestone.
Added
- π New
ForbiddenNamesAsDeclared
sniff: detection of the other reserved keywords which are reserved as of PHP 7.0 (or higher). #287. Fixes #115.
These were previously sniffed for by theForbiddenNames
andForbiddenNamesAsInvokedFunctions
sniffs causing false positives as the rules for their reservation are different from the rules for "normal" reserved keywords. - β New
inUseScope()
utility method to thePHPCompatibility_Sniff
class which handles PHPCS cross-version compatibility when determining the scope of ause
statement. #271. - β More unit tests for the
ForbiddenNames
sniff. #271.
Changed
- π Deprecated functionality should throw a
warning
. Removed or otherwise unavailable functionality should throw anerror
. This distinction was previously not consistently applied everywhere. #286
This change affects the following sniffs:DeprecatedPHP4StyleConstructors
will now throw awarning
instead of anerror
for deprecated PHP4 style class constructors.ForbiddenCallTimePassByReference
will now throw awarning
if thetestVersion
is5.3
and anerror
if thetestVersion
if5.4
or higher.MbstringReplaceEModifier
will now throw awarning
instead of anerror
for usage of the deprecatede
modifier.PregReplaceEModifier
will now throw awarning
if thetestVersion
is5.5
or5.6
and anerror
if thetestVersion
if7.0
or higher. Fixes #290.TernaryOperators
will now throw anerror
when thetestVersion
<5.3
and the middle part has been omitted.ValidIntegers
will now throw awarning
when an invalid binary integer is detected.
- βοΈ
DeprecatedFunctions
andDeprecatedIniDirectives
sniffs: minor change in the sniff error message text. Use "removed" rather than the ominous "forbidden". #285
Also updated relevant internal variable names and documentation to match.
Fixed
- π
ForbiddenNames
sniff would throw false positives foruse
statements which changed the visibility of methods in traits. #271. - π
ForbiddenNames
sniff would not report reserved keywords when used in combination withuse function
oruse const
. #271. - π
ForbiddenNames
sniff would potentially - unintentionally - skip over tokens, thereby - potentially - not reporting all errors. #271. - π§ Composer config:
prefer-stable
should be a root element of the json file. Fixes #277.
Credits
Thanks go out to Juliette Reinders Folmer for her contributions to this version. π