PHPCompatibility v7.0.3 Release Notes
Release Date: 2016-08-18 // over 7 years ago-
👀 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 withdeclare()
. #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 theSerializable
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 theereg
extension in PHP 7. #149 - :star:
DeprecatedFunctions
sniff: detection of the PHP 5.0.5 deprecatedphp_check_syntax()
and PHP 5.4 deprecatedmysqli_get_cache_stats()
functions. #155. - 🗄 :star:
DeprecatedFunctions
sniff: detect deprecation of a number of themysqli
functions in PHP 5.3. #149 - 👉 :star:
DeprecatedFunctions
sniff: detect removal of thecall_user_method()
,ldap_sort()
,ereg_*()
andmysql_*()
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.1array
and PHP 5.4callable
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()
andgetDeclaredNamespaceName()
utility methods in thePHPCompatibility_Sniff
base class for namespace determination. #162 - :recycle: New
inClassScope()
utility method in thePHPCompatibility_Sniff
base class. #168 - :recycle: New
doesFunctionCallHaveParameters()
andgetFunctionCallParameterCount()
utility methods in thePHPCompatibility_Sniff
base class. #153 - :umbrella: Unit test for
__halt_compiler()
detection by theNewKeywords
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 theNewIniDirectives
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 reportwarning
s on deprecation of function parameters. #163 - :twisted_rightwards_arrows: The check for
JsonSerializable
has been moved from theNewClasses
sniff to theNewInterfaces
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 thedirname()
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 thePHPCompatibility_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 theconst
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
andRemovedFunctionParameters
now use the newdoesFunctionCallHaveParameters()
andgetFunctionCallParameterCount()
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:
- 👕 :star2: New