PHPCompatibility v7.1.4 Release Notes
Release Date: 2017-05-06 // about 7 years ago-
โ Added
- ๐ฑ ๐ New
CaseSensitiveKeywords
sniff to detect use of non-lowercaseself
,static
andparent
keywords which could cause compatibility issues pre-PHP 5.5. #382 - ๐ฑ ๐ New
ConstantArraysUsingConst
sniff to detect constants defined using theconst
keyword being assigned an array value which was not supported prior to PHP 5.6. #397 - ๐ฑ ๐ New
ForbiddenClosureUseVariableNames
sniff to detect PHP 7.1 forbidden variable names in closure use statements. #386. Fixes #374 - ๐ฑ ๐ New
NewArrayStringDereferencing
sniff to detect array and string literal dereferencing as introduced in PHP 5.5. #388 - ๐ฑ ๐ New
NewHeredocInitialize
sniff to detect initialization of static variables and class properties/constants using the heredoc syntax which is supported since PHP 5.3. #391. Fixes #51 - ๐ฑ ๐ New
NewMagicClassConstant
sniff to detect use of the magic::class
constant as introduced in PHP 5.5. #403. Fixes #364. - ๐ฑ ๐ New
NewUseConstFunction
sniff to detect use statements importing constants and functions as introduced in PHP 5.6. #401 - ๐ฑ โญ๏ธ
DeprecatedFunctions
sniff: recognize PHP 7.2 deprecated GD functions. #392 - ๐ฑ โญ๏ธ
DeprecatedIniDirectives
sniff: recognize PHP 7.2 deprecatedmbstring.func_overload
directive. #377 - ๐ฑ โญ๏ธ
NewClasses
sniff: check for the PHP 5.1libXMLError
class. #412 - ๐ฑ โญ๏ธ
NewClasses
sniff: recognize all native PHP Exception classes. #418 - ๐ฑ โญ๏ธ
NewClosures
sniff: check for closures being declared as static and closures using$this
. Both of which was not supported pre-PHP 5.4. #389. Fixes #24. - โญ๏ธ
NewFunctionParameters
sniff: recognize newexclude_disabled
parameter for theget_defined_functions()
function as introduced in PHP 7.0.15. #375 - ๐ฑ โญ๏ธ
NewFunctions
sniff: recognize new PHP 7.2 socket related functions. #376 - ๐ฑ โญ๏ธ
NewInterfaces
sniff: check for some more PHP native interfaces. #411 - ๐ฑ โญ๏ธ New
isClassProperty()
,isClassConstant()
andvalidDirectScope()
utility methods to thePHPCompatibility_Sniff
class. #393, #391. - ๐ฑ โญ๏ธ New
getTypeHintsFromFunctionDeclaration()
utility method to thePHPCompatibility_Sniff
class. #414. - ๐ฑ โ๏ธ Unit tests against false positives for the
NewMagicMethods
sniff. #381 - ๐ฑ โ๏ธ More unit tests for the
getTestVersion()
utility method. #405, #430 - ๐ ๐ The XML of the ruleset will now be validated and checked for consistent code style during the build testing by Travis. #433
- ๐ฑ ๐ Readme: information about setting
installed_paths
via a custom ruleset. #407 - ๐ ๐
Changelog.md
file containing a record of notable changes since the first tagged release. #421
๐ Changed
- ๐ฑ ๐ The
ForbiddenNamesAsDeclared
sniff will now emitwarning
s for soft reserved keywords. #406, #370. - ๐ฑ ๐ The
ForbiddenNames
sniff will now allow for the more liberal rules for usage of reserved keywords as of PHP 7.0. #417 - ๐ ๐ The
InternalInterfaces
,NewClasses
,NewConstVisibility
,NewInterfaces
,NewMagicMethods
,NonStaticMagicMethods
andRemovedGlobalVariables
sniffs will now also sniff for and correctly report violations in combination with anonymous classes. #378, #383, #393, #394, #395, #396. Fixes #351 and #333. - ๐ฑ ๐ The
NewClasses
andNewInterfaces
sniffs will now also report on new classes/interfaces when used as type hints. #414, #416. Fixes #352 - ๐ฑ ๐ The
NewClasses
sniff will now also report on Exception classes when used in (multi-)catch
statements. #418. Fixes #373. - ๐ฑ ๐ The
NewScalarTypeDeclarations
sniff will now report on new type hints even when the type hint is nullable. #379 - ๐ The
NewNowdoc
sniff has been renamed toNewNowdocQuotedHeredoc
and will now also check for double quoted heredoc identifiers as introduced in PHP 5.3. #390 - ๐ฑ โช The
NewClasses
sniff will now also report anonymous classes whichextend
a new sniff when used in combination with PHPCS 2.4.0-2.8.0. #432. Fixes #334. - ๐ฑ โ๏ธ
NewFunctionParameter
sniff: version number precision for two parameters. #384, #428 - ๐ฑ โ๏ธ Skipping two unit tests for the
ForbiddenClosureUseVariable
sniff when run on PHPCS 2.5.1 as these cause an infinite loop due to an upstream bug. #408 - ๐ฑ โ๏ธ Skipping unit tests involving
trait
s in combination with PHP < 5.4 and PHPCS < 2.4.0 astrait
s are not recognized in those circumstances. #431 - ๐ โป๏ธ Various (minor) refactoring for improved performance and sniff accuracy. #385, #387, #415, #423, #424
- ๐ฑ โป๏ธ Minor simplification of the PHPUnit 6 compatibility layer and other test code. #426, #425
- General housekeeping. #398, #400
- ๐ ๐ง Minor tweaks to the Travis build script. #409
- ๐ฑ ๐ The sniffs are now also tested against PHP nightly for consistent results. #380
๐ Fixed
- ๐ฑ ๐ฅ Using unbounded ranges in
testVersion
resulted in unreported errors when used with sniffs using thesupportsBelow()
method. This affected the results of approximately half the sniffs. #430 - ๐ฑ ๐ The
ForbiddenNames
sniff would throw false positives foruse
statements with thefinal
modifier in traits. #402. - ๐ฑ ๐ The
ForbiddenNames
sniff would fail to report on functions declared to return by reference using a reserved keyword as the function name. #413 - ๐ฑ ๐ The
ForbiddenNames
sniff would only examine the first part of a namespace and not report on reserved keywords used in subsequent parts of a nested namespace. #419 - ๐ฑ ๐ The
ForbiddenNames
sniff would not always correctly report on use statements importing constants or functions using reserved keywords. #420 - ๐ฑ ๐ The
NewKeywords
sniff would sometimes fail to report on theconst
keyword when used in a class, but not for a class constant. #424 - ๐ ๐ PHPCS has released version 3.0 and updated the
master
branch to reflect this. This was causing the builds to fail. #422
Credits
๐ฑ Thanks go out to Juliette Reinders Folmer and Mark Clements for their contributions to this version. ๐
- ๐ฑ ๐ New