Skip to content

Instantly share code, notes, and snippets.

@jrfnl
Last active Mar 23, 2019
Embed
What would you like to do?
Draft: PHPCS 4.0 remove deprecated methods and properties

The following methods and properties have been deprecated in PHPCS 3.5.0 and should be removed in PHPCS 4.0.0:

Methods:

  • PHP_CodeSniffer\Files\File::hasCondition()
  • PHP_CodeSniffer\Files\File::getCondition()
  • PHP_CodeSniffer\Files\File::getClassProperties()
  • PHP_CodeSniffer\Files\File::findExtendedClassName()
  • PHP_CodeSniffer\Files\File::findImplementedInterfaceNames()
  • PHP_CodeSniffer\Files\File::getMethodParameters()
  • PHP_CodeSniffer\Files\File::getMethodProperties()
  • PHP_CodeSniffer\Files\File::getMemberProperties()
  • PHP_CodeSniffer\Files\File::isReference()
  • PHP_CodeSniffer\Files\File::getDeclarationName()
  • PHP_CodeSniffer\Util\Common::isCamelCaps()
  • PHP_CodeSniffer\Util\Common::isUnderscoreName()
  • PHP_CodeSniffer\Util\Common::suggestType()

Properties:

  • PHP_CodeSniffer\Sniffs\AbstractVariableSniff::$phpReservedVars
  • PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff::$magicMethods
  • PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff::$methodsDoubleUnderscore
  • PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff::$magicFunctions
  • PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff::$magicMethods
  • PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff::$magicFunctions
  • PHP_CodeSniffer\Util\Common::$allowedTypes

Other:

  • The "old property recreation" code in the class constructors of the \PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff and \PHP_CodeSniffer\Standards\PEAR\Sniffs\NamingConventions\ValidFunctionNameSniff classes can also be removed. Internally, the classes already use the new properties in the utility class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment