github PHPCompatibility/PHPCompatibility 7.0.8
7.0.8: PHP 7.0 Sniffs - update 2016-10-31 - Spooky !

latest releases: 9.3.5, 9.3.4, 9.3.3...
7 years ago

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 the ForbiddenNames and ForbiddenNamesAsInvokedFunctions sniffs causing false positives as the rules for their reservation are different from the rules for "normal" reserved keywords.
  • ⭐ New inUseScope() utility method to the PHPCompatibility_Sniff class which handles PHPCS cross-version compatibility when determining the scope of a use statement. #271.
  • ☔ More unit tests for the ForbiddenNames sniff. #271.

Changed

  • 📌 Deprecated functionality should throw a warning. Removed or otherwise unavailable functionality should throw an error. This distinction was previously not consistently applied everywhere. #286
    This change affects the following sniffs:
    • DeprecatedPHP4StyleConstructors will now throw a warning instead of an error for deprecated PHP4 style class constructors.
    • ForbiddenCallTimePassByReference will now throw a warning if the testVersion is 5.3 and an error if the testVersion if 5.4 or higher.
    • MbstringReplaceEModifier will now throw a warning instead of an error for usage of the deprecated e modifier.
    • PregReplaceEModifier will now throw a warning if the testVersion is 5.5 or 5.6 and an error if the testVersion if 7.0 or higher. Fixes #290.
    • TernaryOperators will now throw an error when the testVersion < 5.3 and the middle part has been omitted.
    • ValidIntegers will now throw a warning when an invalid binary integer is detected.
  • ✏️ DeprecatedFunctions and DeprecatedIniDirectives 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 for use statements which changed the visibility of methods in traits. #271.
  • 🐛 ForbiddenNames sniff would not report reserved keywords when used in combination with use function or use 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. 👏

Don't miss a new PHPCompatibility release

NewReleases is sending notifications on new releases.