All Versions
31
Latest Version
Avg Release Cycle
52 days
Latest Release
668 days ago

Changelog History
Page 3

  • v7.0.8 Changes

    October 31, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.8 milestone].

    βž• Added

    • πŸ›  :star2: 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.
    • :star: New inUseScope() utility method to the PHPCompatibility_Sniff class which handles PHPCS cross-version compatibility when determining the scope of a use statement. #271.
    • βœ… :umbrella: More unit tests for the ForbiddenNames sniff. #271.

    πŸ”„ Changed

    • πŸ—„ :pushpin: 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.
    • 🚚 :pencil2: 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

    • :bug: ForbiddenNames sniff would throw false positives for use statements which changed the visibility of methods in traits. #271.
    • :bug: ForbiddenNames sniff would not report reserved keywords when used in combination with use function or use const. #271.
    • :bug: ForbiddenNames sniff would potentially - unintentionally - skip over tokens, thereby - potentially - not reporting all errors. #271.
    • πŸ›  :wrench: 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. :clap:

  • v7.0.7 Changes

    October 20, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.7 milestone].

    βž• Added

    • πŸ›  :star2: New ForbiddenBreakContinueOutsideLoop sniff: verify that break/continue is not used outside of a loop structure. This will cause fatal errors since PHP 7.0. #278. Fixes #275
    • πŸ›  :star2: New NewConstVisibility sniff: detect visibility indicators for class and interface constants as introduced in PHP 7.1. #280. Fixes #249
    • :star2: New NewHashAlgorithms sniff to check used hash algorithms against the PHP version in which they were introduced. #242
    • πŸ›  :star2: New NewMultiCatch sniff: detect catch statements catching multiple Exceptions as introduced in PHP 7.1. #281. Fixes #251
    • πŸ›  :star2: New NewNullableTypes sniff: detect nullable parameter and return type hints (only supported in PHPCS >= 2.3.4) as introduced in PHP 7.1. #282. Fixes #247
    • 🚚 :star: DeprecatedIniDirectives sniff: recognize PHP 7.1 removed session ini directives. #256
    • :star: NewFunctions sniff: recognize new socket_export_stream() function as introduced in PHP 7.0.7. #264
    • :star: NewFunctions sniff: recognize new curl_...(), is_iterable(), pcntl_async_signals(), session_create_id(), session_gc() functions as introduced in PHP 7.1. #273
    • :star: NewFunctionParameters sniff: recognize new OpenSSL function parameters as introduced in PHP 7.1. #258
    • :star: NewIniDirectives sniff: recognize new session ini directives as introduced in PHP 7.1. #259
    • :star: NewScalarReturnTypeDeclarations sniff: recognize PHP 7.1 void return type hint. #250
    • :star: NewScalarTypeDeclarations sniff: recognize PHP 7.1 iterable type hint. #255
    • 🚚 :star: Recognize the PHP 7.1 deprecated mcrypt functionality in the RemovedExtensions, DeprecatedFunctions and DeprecatedIniDirectives sniffs. #257

    πŸ”„ Changed

    • 🚚 :pushpin: LongArrays sniff used to only throw warnings. It will now throw errors for PHP versions in which the long superglobals have been removed. #270
    • ⚠ :pushpin: The NewIniDirectives sniff used to always throw an warning. Now it will throw an error when a new ini directive is used in combination with ini_set(). #246.
    • 🚚 :pushpin: RemovedHashAlgorithms sniff: also recognize removed algorithms when used with the PHP 5.5+ hash_pbkdf2() function. #240
    • :pushpin: Properly recognize nullable type hints in the getMethodParameters() utility method. #282
    • πŸ’… :pencil2: DeprecatedPHP4StyleConstructors sniff: minor error message text fix. #236
    • :pencil2: NewIniDirectives sniff: improved precision for the introduction version numbers being reported. #246
    • 🐎 :recycle: Various (minor) refactoring for improved performance and sniff accuracy. #238, #244, #240, #276
    • βœ… :umbrella: Re-activate the unit tests for the NewScalarReturnTypeDeclarations sniff. #250

    πŸ›  Fixed

    • πŸ’… :bug: The DeprecatedPHP4StyleConstructors sniff would not report errors when the case of the class name and the PHP4 constructor function name did not match. #236
    • 🚚 :bug: LongArrays sniff would report false positives for class properties shadowing removed PHP superglobals. #270. Fixes #268.
    • :bug: The NewClasses sniff would not report errors when the case of the class name used and "official" class name did not match. #237
    • :bug: The NewIniDirectives sniff would report violations against the PHP version in which the ini directive was introduced. This should be the version below it. #246
    • πŸ›  :bug: PregReplaceEModifier sniff would report false positives for compound regex parameters with different quote types. #266. Fixes #265.
    • 🚚 :bug: RemovedGlobalVariables sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. #245.
    • 🚚 :bug: The RemovedHashAlgorithms sniff would not report errors when the case of the hash function name used and "official" class name did not match. #240
    • :bug: The ShortArray sniff would report all violations on the line of the PHP open tag, not on the lines of the short array open/close tags. #238

    Credits

    Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap:

  • v7.0.6 Changes

    September 23, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.6 milestone].

    βž• Added

    • :star: New stripQuotes() utility method in the PHPCompatibility_Sniff base class to strip quotes which surround text strings in a consistent manner. #224
    • πŸ‘ :books: Readme: Add PHP Version Support section. #225

    πŸ”„ Changed

    • πŸ—„ :pushpin: The ForbiddenCallTimePassByReference sniff will now also report the deprecation as of PHP 5.3, not just its removal as of PHP 5.4. #203
    • :pushpin: The NewFunctionArrayDereferencing sniff will now also check method calls for array dereferencing, not just function calls. #229. Fixes #227.
    • ⚠ :pencil2: The NewExecutionDirectives sniff will now throw warnings instead of errors for invalid values encountered in execution directives. #223
    • πŸ›  :pencil2: Minor miscellaneous fixes. #231
    • 🐎 :recycle: Various (minor) refactoring for improved performance and sniff accuracy. #219, #203
    • :recycle: Defer to upstream findImplementedInterfaceNames() utility method when it exists. #222
    • βœ… :wrench: Exclude the test files from analysis by Scrutinizer CI. #230

    βœ‚ Removed

    • :no_entry_sign: Some redundant code. #232

    πŸ›  Fixed

    • πŸ›  :bug: The EmptyNonVariable sniff would throw false positives for variable variables and for array access with a (partially) variable array index. #212. Fixes #210.
    • πŸ›  :bug: The NewFunctionArrayDereferencing sniff would throw false positives for lines of code containing both a function call as well as square brackets, even when they were unrelated. #228. Fixes #226.
    • πŸ›  :bug: ParameterShadowSuperGlobals sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. #218. Fixes #214.
    • :bug: The determineNamespace() utility method now accounts properly for namespaces within scoped declare() statements. #221
    • :books: Readme: Logo alignment in the Credits section. #233

    Credits

    Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Mark Clements] for their contributions to this version. :clap:

  • v7.0.5 Changes

    September 08, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.5 milestone].

    βž• Added

    • πŸ—„ :star2: New MbstringReplaceEModifier sniff to detect the use of the PHP 7.1 deprecated e modifier in Mbstring regex functions. #202
    • :star: The ForbiddenBreakContinueVariableArguments sniff will now also report on break 0/continue 0 which is not allowed since PHP 5.4. #209
    • :star: New getFunctionCallParameters(), getFunctionCallParameter() utility methods in the PHPCompatibility_Sniff base class. #170
    • :star: New tokenHasScope() utility method in the PHPCompatibility_Sniff base class. #189
    • βœ… :umbrella: Unit test for goto and callable detection and some other miscellanous extra unit tests for the NewKeywords sniff. #189
    • :books: Readme: Information for sniff developers about running unit tests for other sniff libraries using the PHPCS native test framework without running into conflicts with the PHPCompatibility specific unit test framework. #217

    πŸ”„ Changed

    • :pushpin: The ForbiddenNames sniff will now also check interface declarations for usage of reserved keywords. #200
    • πŸ— :pushpin: PregReplaceEModifier sniff: improved handling of regexes build up of a combination of variables, function calls and/or text strings. #201
    • :rewind: The NewKeywords sniff will now also correctly recognize new keywords when used in combination with older PHPCS versions and/or run on older PHP versions. #189
    • :pencil2: PregReplaceEModifier sniff: minor improvement to the error message text. #201
    • 🐎 :recycle: Various (minor) refactoring for improved performance and sniff accuracy. #170, #188, #189, #199, #200, #201, #208
    • 🚚 :wrench: The unit tests for the utility methods have been moved to their own subdirectory within Tests. #215
    • βœ… :green_heart: The sniffs are now also tested against PHP 7.1 for consistent results. #216

    βœ‚ Removed

    πŸ›  Fixed

    • :bug: ConstantArraysUsingDefine sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #199
    • πŸ—„ :bug: The DeprecatedIniDirectives and NewIniDirectives sniffs could potentially trigger on the ini value instead of the ini directive name. #170
    • βœ… :bug: ForbiddenNames sniff: Reserved keywords when used as the name of a constant declared using define() would always be reported independently of the testVersion set. #200
    • :bug: PregReplaceEModifier sniff would not report errors when the function name used was not in lowercase. #201
    • :bug: TernaryOperators sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #188
    • ⚠ :bug: The getFQClassNameFromNewToken() and getFQClassNameFromDoubleColonToken() utility methods would get confused when the class name was a variable instead of being hard-coded, resulting in a PHP warning being thown. #206. Fixes #205.
    • πŸ›  :bug: The getFunctionCallParameters() utility method would incorrectly identify an extra parameter if the last parameter passed to a function would have an - unnecessary - comma after it. The getFunctionCallParameters() utility method also did not handle parameters passed as short arrays correctly. #213. Fixes #211.
    • βœ… :umbrella: Unit tests for the NewFunctionArrayDereferencing sniff were not being run due to a naming error. #208
    • βœ… :books: Readme: Information about setting the testVersion from a custom ruleset was incorrect. #204
    • βœ… :wrench: Path to PHPCS in the unit tests breaking for non-Composer installs. #198

    Credits

    Thanks go out to [Juliette Reinders Folmer] and [Yoshiaki Yoshida] for their contributions to this version. :clap:

  • v7.0.4 Changes

    August 20, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.4 milestone].

    βž• Added

    • :star2: New EmptyNonVariable sniff: detection of empty being used on non-variables for PHP < 5.5. #187
    • πŸ›  :star2: New NewMagicMethods sniff: detection of declaration of magic methods before the method became "magic". Includes a check for the changed behaviour for the __toString() magic method in PHP 5.2. #176. Fixes #64.
    • 🚚 :star2: New RemovedAlternativePHPTags sniff: detection of ASP and script open tags for which support was removed in PHP 7.0. #184, #193. Fixes #127.
    • :star: NonStaticMagicMethods sniff: detection of the __callStatic(), __sleep(), __toString() and __set_state() magic methods.
    • πŸ‘• :green_heart: Lint all non-test case files for syntax errors during the build testing by Travis. #192

    πŸ”„ Changed

    • :pushpin: NonStaticMagicMethods sniff: will now also sniff traits for magic methods. #174
    • :pushpin: NonStaticMagicMethods sniff: will now also check for magic methods which should be declared as static. #174
    • 🐎 :recycle: Various (minor) refactoring for improved performance and sniff accuracy. #178, #179, #174, #171
    • βœ… :recycle: The unit test suite now internally caches PHPCS run results in combination with a set testVersion to speed up the running of the unit tests. These are now ~3 x faster. #148
    • :books: Readme: Minor clarification of the minimum requirements.
    • βœ… :books: Readme: Advise to use the latest stable version of this repository.
    • βœ… :wrench: The unit tests can now be run with PHPCS installed in an arbitrary location by passing the location through an environment option. #191.
    • πŸ”§ :wrench: Improved coveralls configuration and compatibility. #194
    • βœ… :green_heart: The sniffs are now also tested against PHP 5.2 for consistent results. Except for namespace, trait and group use related errors, most sniffs work as intended on PHP 5.2. #196

    πŸ›  Fixed

    • :bug: The ForbiddenBreakContinueVariableArguments sniff would not report on break/continue with a closure as an argument. #171
    • :bug: The ForbiddenNamesAsInvokedFunctions sniff would not report on reserved keywords which were not lowercase. #186
    • :bug: The ForbiddenNamesAsInvokedFunctions sniff would not report on the goto and namespace keywords when run on PHP 5.2. #193
    • :bug: NewAnonymousClasses sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #195.
    • :bug: NewGroupUseDeclarations sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #190.
    • :bug: The NonStaticMagicMethods sniff would not report on magic methods when the function name as declared was not in the same case as used in the PHP manual. #174
    • βœ… :wrench: The unit tests would exit with 0 if PHPCS could not be found. #191
    • :green_heart: The PHPCompatibility library itself was not fully compatible with PHP 5.2. #193

    Credits

    Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap:

  • v7.0.3 Changes

    August 18, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.3 milestone].

    βž• Added

    • πŸ‘• :star2: New InternalInterfaces sniff: detection of internal PHP interfaces being which should not be implemented by user land classes. #144
    • βœ… :star2: New LateStaticBinding sniff: detection of PHP 5.3 late static binding. #177
    • :star2: New NewExecutionDirectives sniff: verify execution directives set with declare(). #169
    • πŸ‘ :star2: New NewInterfaces sniff: detection of the use of newly introduced PHP native interfaces. This sniff will also detect unsupported methods when a class implements the Serializable interface. #144
    • :star2: New RequiredOptionalFunctionParameters sniff: detection of missing function parameters which were required in earlier PHP versions only to become optional in later versions. #165
    • 🚚 :star2: New ValidIntegers sniff: detection of binary integers for PHP < 5.4, detection of hexademical numeric strings for which recognition as hex integers was removed in PHP 7.0, detection of invalid binary and octal integers. #160. Fixes #55.
    • πŸ—„ :star: DeprecatedExtensions sniff: detect removal of the ereg extension in PHP 7. #149
    • :star: DeprecatedFunctions sniff: detection of the PHP 5.0.5 deprecated php_check_syntax() and PHP 5.4 deprecated mysqli_get_cache_stats() functions. #155.
    • πŸ—„ :star: DeprecatedFunctions sniff: detect deprecation of a number of the mysqli functions in PHP 5.3. #149
    • πŸ‘‰ :star: DeprecatedFunctions sniff: detect removal of the call_user_method(), ldap_sort(), ereg_*() and mysql_*() functions in PHP 7.0. #149
    • :star: DeprecatedIniDirectives sniff: detection of a lot more deprecated/removed ini directives. #146
    • :star: NewFunctionParameters sniff: detection of a lot more new function parameters. #164
    • :star: NewFunctions sniff: detection of numerous extra new functions. #161
    • :star: NewIniDirectives sniff: detection of a lot more new ini directives. #146
    • :star: NewLanguageConstructs sniff: detection of the PHP 5.6 ellipsis ... construct. #175
    • :star: NewScalarTypeDeclarations sniff: detection of PHP 5.1 array and PHP 5.4 callable type hints. #168
    • 🚚 :star: RemovedFunctionParameters sniff: detection of a few extra removed function parameters. #163
    • :star: Detection of functions and methods with a double underscore prefix as these are reserved by PHP for future use. The existing upstream Generic.NamingConventions.CamelCapsFunctionName sniff is re-used for this with some customization. #173
    • :star: New getFQClassNameFromNewToken(), getFQExtendedClassName(), getFQClassNameFromDoubleColonToken(), getFQName(), isNamespaced(), determineNamespace() and getDeclaredNamespaceName() utility methods in the PHPCompatibility_Sniff base class for namespace determination. #162
    • :recycle: New inClassScope() utility method in the PHPCompatibility_Sniff base class. #168
    • :recycle: New doesFunctionCallHaveParameters() and getFunctionCallParameterCount() utility methods in the PHPCompatibility_Sniff base class. #153
    • :umbrella: Unit test for __halt_compiler() detection by the NewKeywords sniff.
    • βœ… :umbrella: Unit tests for the NewFunctions sniff. #161
    • βœ… :umbrella: Unit tests for the ParameterShadowSuperGlobals sniff. #180
    • :wrench: Minimal config for Scrutinizer CI. #145.

    πŸ”„ Changed

    • πŸ—„ :pushpin: The DeprecatedIniDirectives and the NewIniDirectives sniffs will now indicate an alternative ini directive in case the directive has been renamed. #146
    • :pushpin: The NewClasses sniff will now also report on new classes being extended by child classes. #140.
    • :pushpin: The NewClasses sniff will now also report on static use of new classes. #162.
    • :pushpin: The NewScalarTypeDeclarations sniff will now throw an error on use of type hints pre-PHP 5.0. #168
    • :pushpin: The NewScalarTypeDeclarations sniff will now verify type hints used against typical mistakes. #168
    • :pushpin: The ParameterShadowSuperGlobals sniff will now do a case-insensitive variable name compare. #180
    • 🚚 :pushpin: The RemovedFunctionParameters sniff will now also report warnings on deprecation of function parameters. #163
    • :twisted_rightwards_arrows: The check for JsonSerializable has been moved from the NewClasses sniff to the NewInterfaces sniff. #162
    • :rewind: The NewLanguageConstructs sniff will now also recognize new language constructs when used in combination with PHPCS 1.5.x. #175
    • :pencil2: NewFunctionParameters sniff: use correct name for the new parameter for the dirname() function. #164
    • :pencil2: NewScalarTypeDeclarations sniff: minor change in the sniff error message text. #168
    • 🚚 :pencil2: RemovedFunctionParameters sniff: minor change in the sniff error message text. #163
    • :pencil2: The ParameterShadowSuperGlobals sniff now extends the PHPCompatibility_Sniff class. #180
    • 🐎 :recycle: Various (minor) refactoring for improved performance and sniff accuracy. #181, #182, #166, #167, #172, #180, #146, #138
    • ♻️ :recycle: Various refactoring to remove code duplication in the unit tests and add proper test skip notifications where relevant. #139, #149

    πŸ›  Fixed

    • πŸ—„ :bug: The DeprecatedFunctions sniff was reporting an incorrect deprecation/removal version number for a few functions. #149
    • πŸ—„ :bug: The DeprecatedIniDirectives sniff was in select cases reporting deprecation of an ini directive prior to removal, while the ini directive was never deprecated prior to its removal. #146
    • πŸ’… :bug: The DeprecatedPHP4StyleConstructors sniff would cause false positives for methods with the same name as the class in namespaced classes. #167
    • :bug: The ForbiddenEmptyListAssignment sniff did not report errors when there were only comments or parentheses between the list parentheses. #166
    • :bug: The ForbiddenEmptyListAssignment sniff will no longer cause false positives during live coding. #166
    • :bug: The NewClasses sniff would potentially misidentify namespaced classes as PHP native classes. #161
    • :bug: The NewFunctions sniff would fail to identify called functions when the function call was not lowercase. #161
    • :bug: The NewFunctions sniff would potentially misidentify namespaced userland functions as new functions. #161
    • :bug: The NewIniDirectives sniff was reporting an incorrect introduction version number for a few ini directives. #146
    • πŸ›  :bug: NewKeywords sniff: the use of the const keyword should only be reported when used outside of a class for PHP < 5.3. #147. Fixes #129.
    • 🚚 :bug: The RemovedExtensions sniff was incorrectly reporting a number of extensions as being removed in PHP 5.3 while they were actually removed in PHP 5.1. #156
    • 🚚 :bug: :recycle: The NewFunctionParameters and RemovedFunctionParameters now use the new doesFunctionCallHaveParameters() and getFunctionCallParameterCount() utility methods for improved accuracy in identifying function parameters. This fixes several false positives. #153 Fixes #120, #151, #152.
    • :bug: A number of sniffs would return false if the examined construct was not found. This could potentially cause race conditions/infinite sniff loops. #138
    • βœ… :wrench: The unit tests would fail to run when used in combination with a PEAR install of PHPCS. #157.
    • βœ… :green_heart: Unit tests failing against PHPCS 2.6.1. #158 The unit tests will still fail against PHPCS 2.6.2 due to a bug in PHPCS itself. This bug does not affect the running of the sniffs outside of a unit test context.

    Credits

    Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap:

  • v7.0.2 Changes

    August 03, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.2 milestone].

    βž• Added

    • 🚚 :star: RemovedExtensions sniff: ability to whitelist userland functions for which the function prefix overlaps with a prefix of a deprecated/removed extension. #130. Fixes #123. To use this feature, add the functionWhitelist property in your custom ruleset. For more information, see the README.

    πŸ”„ Changed

    • :pencil2: A number of sniffs contained public class properties. Within PHPCS, public properties can be overruled via a custom ruleset. This was not the intention, so the visibility of these properties has been changed to protected. #135
    • πŸ“¦ :wrench: Composer config: Stable packages are preferred over unstable/dev.
    • :pencil2: Ruleset name. #134

    Credits

    Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap:

  • v7.0.1 Changes

    August 02, 2016

    πŸ‘€ See all related issues and PRs in the [7.0.1 milestone].

    πŸ”„ Changed

    • πŸ—„ :pushpin: The DeprecatedIniDirectives sniff used to throw an error when a deprecated ini directive was used in combination with ini_get(). It will now throw a warning instead. #122 Fixes #119. Usage of deprecated ini directives in combination with ini_set() will still throw an error.
    • πŸ‘ :pushpin: The PregReplaceEModifier sniff now also detects the e modifier when used with the preg_filter() function. While this is undocumented, the e modifier was supported by the preg_filter() function as well. #128
    • 🚚 :pencil2: The RemovedExtensions sniff contained superfluous deprecation information in the error message. #131

    βœ‚ Removed

    • πŸ— :wrench: Duplicate builds from the Travis CI build matrix. #132

    πŸ›  Fixed

    • πŸ›  :bug: The ForbiddenNames sniff did not allow for the PHP 5.6 use function ... and use const ... syntax. #126 Fixes #124.
    • :bug: The NewClasses sniff failed to detect new classes when the class was instantiated without parenthesis, i.e. new NewClass;. #121
    • :bug: The PregReplaceEModifier sniff failed to detect the e modifier when using bracket delimiters for the regex other than the {} brackets. #128
    • βœ… :green_heart: Unit tests failing against PHPCS 2.6.1.

    Credits

    Thanks go out to [Jason Stallings], [Juliette Reinders Folmer] and [Ryan Neufeld] for their contributions to this version. :clap:

  • v7.0 Changes

    July 02, 2016

    πŸ‘€ See all related issues and PRs in the [7.0 milestone].

    βž• Added

    • βœ… :zap: Ability to specify a range of PHP versions against which to test your code base for compatibility, i.e. --runtime-set testVersion 5.0-5.4 will now test your code for compatibility with PHP 5.0 up to PHP 5.4. #99
    • πŸ›  :star2: New NewFunctionArrayDereferencing sniff to detect function array dereferencing as introduced in PHP 5.4. Fixes #52.
    • πŸ›  :star2: New ShortArray sniff to detect short array syntax as introduced in PHP 5.4. #97. Fixes #47.
    • πŸ›  :star2: New TernaryOperators sniff to detect ternaries without the middle part (elvis operator) as introduced in PHP 5.3. #101, #103. Fixes #49.
    • :star2: New ConstantArraysUsingDefine sniff to detect constants declared using define() being assigned an array value which was not allowed prior to PHP 7.0. #110
    • πŸ’… :star2: New DeprecatedPHP4StyleConstructors sniff to detect PHP 4 style class constructor methods which are deprecated as of PHP 7. #109.
    • 🚚 :star2: New ForbiddenEmptyListAssignment sniff to detect empty list() assignments which have been removed in PHP 7.0. #110
    • :star2: New ForbiddenFunctionParametersWithSameName sniff to detect functions declared with multiple same-named parameters which is no longer accepted since PHP 7.0. #110
    • :star2: New ForbiddenGlobalVariableVariable sniff to detect variable variables being made global which is not allowed since PHP 7.0. #110
    • :star2: New ForbiddenNegativeBitshift sniff to detect bitwise shifts by negative number which will throw an ArithmeticError in PHP 7.0. #110
    • 0️⃣ :star2: New ForbiddenSwitchWithMultipleDefaultBlocks sniff to detect switch statements with multiple default blocks which is not allowed since PHP 7.0. #110
    • :star2: New NewAnonymousClasses sniff to detect anonymous classes as introduced in PHP 7.0. #110
    • πŸ›  :star2: New NewClosure sniff to detect anonymous functions as introduced in PHP 5.3. Fixes #35
    • πŸ— :star2: New NewFunctionParameters sniff to detect use of new parameters in build-in PHP functions. Initially only sniffing for the new PHP 7.0 function parameters and the new PHP 5.3+ before_needle parameter for the strstr() function. #110, #112. Fixes #27.
    • :star2: New NewGroupUseDeclarations sniff to detect group use declarations as introduced in PHP 7.0. #110
    • :star2: New NewScalarReturnTypeDeclarations sniff to detect scalar return type hints as introduced in PHP 7.0. #110
    • :star2: New NewScalarTypeDeclarations sniff to detect scalar function parameter type hints as introduced in PHP 7.0. #110
    • πŸ— :star2: New RemovedFunctionParameters sniff to detect use of removed parameters in build-in PHP functions. Initially only sniffing for the function parameters removed in PHP 7.0. #110
    • :star2: New RemovedGlobalVariables sniff to detect the PHP 7.0 removed $HTTP_RAW_POST_DATA superglobal. #110
    • πŸ—„ :star: DeprecatedFunctions sniff: detection of the PHP 5.4 deprecated OCI8 functions. #93
    • :star: ForbiddenNamesAsInvokedFunctions sniff: recognize PHP 5.5 finally as a reserved keywords when invoked as a function. #110
    • :star: NewKeywords sniff: detection of the use of the PHP 5.1+ __halt_compiler keyword. Fixes #50.
    • πŸ›  :star: NewKeywords sniff: detection of the PHP 5.3+ nowdoc syntax. Fixes #48.
    • πŸ›  :star: NewKeywords sniff: detection of the use of the const keyword outside of a class for PHP < 5.3. Fixes #50.
    • 🚚 :star: DeprecatedFunctions sniff: recognize PHP 7.0 deprecated and removed functions. #110
    • 🚚 :star: DeprecatedIniDirectives sniff: recognize PHP 7.0 removed ini directives. #110
    • :star: ForbiddenNamesAsInvokedFunctions sniff: recognize new PHP 7.0 reserved keywords when invoked as functions. #110
    • :star: ForbiddenNames sniff: recognize new PHP 7.0 reserved keywords. #110
    • :star: NewFunctions sniff: recognize new functions as introduced in PHP 7.0. #110
    • :star: NewLanguageConstructs sniff: recognize new PHP 7.0 <=> "spaceship" and ?? null coalescing operators. #110
    • 🚚 :star: RemovedExtensions sniff: recognize PHP 7.0 removed ereg, mssql, mysql and sybase_ct extensions. #110
    • βœ… :umbrella: Additional unit tests for the NewLanguageConstructs sniff. #110
    • βœ… :books: Readme: New section containing information about the use of the testVersion config variable.
    • :books: Readme: Sponsor credits.

    πŸ”„ Changed

    • 🚚 :pushpin: The DeprecatedIniDirectives sniff used to always throw an warning. Now it will throw an error when a removed ini directive is used. #110.
    • βœ… :pushpin: The DeprecatedNewReference sniff will now throw an error when the testVersion includes PHP 7.0 or higher. #110
    • πŸ‘ :pushpin: The ForbiddenNames sniff now supports detection of reserved keywords when used in combination with PHP 7 anonymous classes. #108, #110.
    • βœ… :pushpin: The PregReplaceEModifier sniff will now throw an error when the testVersion includes PHP 7.0 or higher. #110
    • πŸ›  :pencil2: NewKeywords sniff: clarified the error message text for the use keyword. Fixes #46.
    • ♻️ :recycle: Minor refactor of the testVersion related utility functions. #98
    • πŸ›  :wrench: Add autoload to the composer.json file. #96 Fixes #67.
    • ⚑️ :wrench: Minor other updates to the composer.json file. #75
    • :wrench: Improved creation of the code coverage reports needed by coveralls via Travis.
    • βœ… :green_heart: The sniffs are now also tested against PHP 7.0 for consistent results.

    πŸ›  Fixed

    • πŸ›  :bug: The ForbiddenCallTimePassByReference sniff was throwing Undefined index notices when used in combination with PHPCS 2.2.0. #100. Fixes #42.
    • πŸ›  :bug: The ForbiddenNamesAsInvokedFunctions sniff would incorrectly throw an error if the throw keyword was used with parenthesis. Fixes #118.
    • :bug: The PregReplaceEModifier sniff incorrectly identified e's in the pattern as the e modifier when using {} bracket delimiters for the regex. #94
    • 🚚 :bug: The RemovedExtensions sniff was throwing an error instead of a warning for deprecated, but not (yet) removed extensions. Fixes #62.

    Credits

    Thanks go out to AlexMiroshnikov, [Chris Abernethy], [dgudgeon], [djaenecke], [Eugene Maslovich], [Ken Guest], Koen Eelen, [Komarov Alexey], [Mark Clements] and [Remko van Bezooijen] for their contributions to this version. :clap:

  • v5.6 Changes

    September 14, 2015

    πŸ‘€ See all related issues and PRs in the [5.6 milestone].

    βž• Added

    • :star2: New: NewLanguageConstructs sniff. The initial version of this sniff checks for the PHP 5.6 ** power operator and the **= power assignment operator. #87. Fixes #60.
    • :star2: New: ParameterShadowSuperGlobals sniff which covers the PHP 5.4 change Parameter names that shadow super globals now cause a fatal error.`. #74
    • πŸ›  :star2: New: PregReplaceEModifier sniff which detects usage of the e modifier in literal regular expressions used with preg_replace(). The e modifier will not (yet) be detected when the regex passed is a variable or constant. #81, #84. Fixes #71, #83.
    • πŸ—„ :star: DeprecatedIniDirectives sniff: PHP 5.6 deprecated ini directives.
    • :star: NewKeywords sniff: detection of the goto keyword introduced in PHP 5.3 and the callable keyword introduced in PHP 5.4. #57
    • βœ… :recycle: PHPCompatibility_Sniff base class initially containing the supportsAbove() and supportsBelow() utility methods. (Nearly) All sniffs now extend this base class and use these methods to determine whether or not violations should be reported for a set testVersion. #77
    • :books: Readme: Composer installation instructions. #32, #61
    • :wrench: .gitignore to ignore vendor and IDE related directories. #78
    • :green_heart: Code coverage checking via coveralls.

    πŸ”„ Changed

    • :twisted_rightwards_arrows: The check for the \ namespace separator has been moved from the NewKeywords sniff to the NewLanguageConstructs sniff. #88
    • πŸ—„ :pencil2: DeprecatedIniDirectives sniff: minor change in the sniff error message text.
    • πŸ—„ :pencil2: DeprecatedFunctions sniff: minor change in the sniff error message text.
    • ⚑️ :wrench: Minor updates to the composer.json file. #31, 34, #70
    • πŸ”§ :wrench: Tests: The unit tests can now be run without configuration.
    • βœ… :wrench: Tests: Skipped unit tests will now be annotated as such. #85
    • βœ… :green_heart: The sniffs are now also tested against PHP 5.6 for consistent results.
    • βœ… :green_heart: The sniffs are now also tested against PHPCS 2.0+.
    • βœ… :green_heart: The sniffs are now tested using the new container-based infrastructure in Travis CI. #37

    πŸ›  Fixed

    • πŸ›  :bug: The ForbiddenCallTimePassByReference sniff was throwing false positives when a bitwise and & was used in combination with class constants and class properties within function calls. #44. Fixes #39.
    • :bug: The ForbiddenNamesAsInvokedFunctions sniff was throwing false positives in certain cases when a comment separated a try from the catch block. #29
    • :bug: The ForbiddenNamesAsInvokedFunctions sniff was incorrectly reporting instanceof as being introduced in PHP 5.4 while it has been around since PHP 5.0. #80
    • :white_check_mark: Compatibility with PHPCS 2.0 - 2.3. #63, #65

    Credits

    Thanks go out to Daniel JΓ€necke, [Declan Kelly], [Dominic], [Jaap van Otterdijk], [Marin Crnkovic], [Mark Clements], [Nick Pack], [Oliver Klee], [Rowan Collins] and [Sam Van der Borght] for their contributions to this version. :clap: