Skip to content

1.0.0-alpha3 - 2020-06-29

Pre-release
Pre-release
Compare
Choose a tag to compare
@jrfnl jrfnl released this 28 Jun 22:31
a16c989

Notes:

  • While still in alpha, some BC-breaks may be introduced. These are clearly indicated in the changelog with the ⚠️ symbol.
  • Until PHPCS 4.x has been released, PHPCSUtils does not formally support it, though an effort is made to keep up with the changes and anticipate potential compatibility issues.
    For testing purposes, the composer configuration allows for PHPCSUtils to be installed with PHPCS 4.x.
  • Until PHP 8.0 has been released, PHPCSUtils does not formally support it, though an effort is made to keep up with the changes and anticipate potential compatibility issues.
    For testing purposes, the composer configuration allows for PHPCSUtils to be installed with PHP 8.

Added

PHPCS Backcompat

  • BCFile::getMethodProperties(): support for "static" as a return type (PHP 8). #134 PHPCS#2952

TestUtils

  • UtilityMethodTestCase: new public $phpcsVersion property for use in tests. #107
    Note: if the PHPCS version is needed within a data provider method for a test, Helper::getVersion() still needs to be used as the data providers are run before the setUpBeforeClass()-like methods which set the property.

Tokens

Utils

  • FunctionDeclarations::getProperties(): support for "static" as a return type (PHP 8). #134

Changed

PHPCS Backcompat

  • BCFile::getDeclarationName(): has been made compatible with PHPCS 4.x. #110
  • BCFile::getMethodProperties(): has been made compatible with PHPCS 4.x. #109
  • BCFile::getMemberProperties(): has been made compatible with PHPCS 4.x. #109
  • BCTokens: ⚠️ The visibility of the BCTokens::$phpcsCommentTokensTypes, BCTokens::$ooScopeTokens, BCTokens::$textStringTokens properties has changed from protected to private. #139
  • Helper::setConfigData(): has been made compatible with PHPCS 4.x. #137
    A new $config parameter has been added to the method. This parameter is a required parameter when the method is used with PHPCS 4.x.

TestUtils

  • UtilityMethodTestCase: tests for JS/CSS will now automatically be skipped when run in combination with PHPCS 4.x (which drops JS/CSS support). #111
  • Confirmed that the currently available test utils are compatible with PHPUnit 9.x. #103

Tokens

  • Collections::$parameterTypeTokens: has been made compatible with PHPCS 4.x. #109
    ⚠️ This removes support for PHPCS < 3.3.0 from the property. Use the Collections::parameterTypeTokensBC() method instead if PHPCS < 3.3.0 needs to be supported.
  • Collections::$propertyTypeTokens: has been made compatible with PHPCS 4.x. #109
    ⚠️ This removes support for PHPCS < 3.3.0 from the property. Use the Collections::propertyTypeTokensBC() method instead if PHPCS < 3.3.0 needs to be supported.
  • Collections::$returnTypeTokens: has been made compatible with PHPCS 4.x. #109
    ⚠️ This removes support for PHPCS < 3.5.4 from the property. Use the Collections::returnTypeTokensBC() method instead if PHPCS < 3.5.4 needs to be supported.

Utils

  • FunctionDeclarations::getArrowFunctionOpenClose(): has been made compatible with PHPCS 4.x. #109
  • FunctionDeclarations::getProperties(): has been made compatible with PHPCS 4.x. #109
  • ⚠️ Lists::getAssignments(): the return value of the method has been consolidated to be less fiddly to work with. #129
    • ⚠️ The nested_list index key in the return value has been renamed to is_nested_list.
  • ObjectDeclarations::getName(): has been made compatible with PHPCS 4.x. #110
  • Variables::getMemberProperties(): has been made compatible with PHPCS 4.x. #109

Other

  • Composer: PHPCSUtils can now be installed in combination with PHPCS 4.0.x-dev@dev for testing purposes.
  • Composer: The version requirements for the DealerDirect Composer PHPCS plugin have been widened to allow for version 0.7.0 which supports Composer 2.0.0.
  • Readme/website homepage: textual improvements. Props @GaryJones. #121
  • Readme/website homepage: added additional FAQ question & answers. #157
  • The website homepage is now generated using the GitHub Pages gem with Jekyll, making maintenance easier. #141
  • Significant improvements to the docblock documentation and by extension the generated API documentation. #145, #146, #147, #148, #149, #150, #151, #152, #153, 154, #155, #156
  • Various housekeeping.

Fixed

Abstract Sniffs

  • AbstractArrayDeclarationSniff: improved parse error handling. #99

PHPCS Backcompat

  • BCFile::findEndOfStatement(): now supports arrow functions when used as a function argument, in line with the same change made in PHPCS 3.5.5. #143
  • BcFile::isReference(): bug fix, the reference operator was not recognized as such for closures declared to return by reference. #160 PHPCS#2977

Utils

  • FunctionDeclarations::getArrowFunctionOpenClose(): now supports arrow functions when used as a function argument, in line with the same change made in PHPCS 3.5.5. #143
  • FunctionDeclarations::getArrowFunctionOpenClose(): now supports for arrow functions returning heredoc/nowdocs, in line with the same change made in PHPCS master and expected to be released in PHPCS 3.5.6. #143
  • FunctionDeclarations::getName(): bug fix for functions declared to return by reference. #131
  • FunctionDeclarations::isMagicFunction(): bug fix for nested functions. #127
  • Operators::isReference(): bug fix, the reference operator was not recognized as such for closures declared to return by reference. #142
  • Namespaces::getType(): improved type detection for when the namespace keyword is used as an operator in the global namespace. #132
  • TextStrings::getCompleteTextString(): will now remove the newline at the end of a heredoc/nowdoc. #136
    PHP itself does not include the last new line in a heredoc/nowdoc text string when handling it, so the method shouldn't either.