All Versions
14
Latest Version
Avg Release Cycle
61 days
Latest Release
1280 days ago

Changelog History
Page 1

  • v3.5.8 Changes

    October 23, 2020
    • βͺ Reverted a change to the way include/exclude patterns are processed for STDIN content
      • This change is not backwards compatible and will be re-introduced in version 3.6.0
  • v3.5.7 Changes

    October 22, 2020
    • The PHP 8.0 T_NULLSAFE_OBJECT_OPERATOR token has been made available for older versions
      • Existing sniffs that check for T_OBJECT_OPERATOR have been modified to apply the same rules for the nullsafe object operator
      • Thanks to Juliette Reinders Folmer for the patch
    • βͺ The new method of PHP 8.0 tokenizing for namespaced names has been revert to the pre 8.0 method
      • This maintains backwards compatible for existing sniffs on PHP 8.0
      • This change will be removed in PHPCS 4.0 as the PHP 8.0 tokenizing method will be backported for pre 8.0 versions
      • Thanks to Juliette Reinders Folmer for the patch
    • βž• Added support for changes to the way PHP 8.0 tokenizes hash comments
      • The existing PHP 5-7 behaviour has been replicated for version 8, so no sniff changes are required
      • Thanks to Juliette Reinders Folmer for the patch
    • The autoloader has been changed to fix sniff class name detection issues that may occur when running on PHP 7.4+
      • Thanks to Eloy Lafuente for the patch
    • βœ… Running the unit tests now includes warnings in the found and fixable error code counts
      • Thanks to Juliette Reinders Folmer for the patch
    • PSR12.ControlStructures.BooleanOperatorPlacement.FoundMixed error message is now more accurate when using the allowOnly setting
      • Thanks to Vincent Langlet for the patch
    • πŸ‘ PSR12.Functions.NullableTypeDeclaration now supports the PHP8 static return type
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed Squiz.Formatting.OperatorBracket false positive when exiting with a negative number
    • πŸ›  Fixed Squiz.PHP.DisallowComparisonAssignment false positive for methods called on an object
    • πŸ›  Fixed bug #2882 : Generic.Arrays.ArrayIndent can request close brace indent to be less than the statement indent level
    • πŸ›  Fixed bug #2883 : Generic.WhiteSpace.ScopeIndent.Incorrect issue after NOWDOC
    • πŸ›  Fixed bug #2975 : Undefined offset in PSR12.Functions.ReturnTypeDeclaration when checking function return type inside ternary
    • πŸ›  Fixed bug #2988 : Undefined offset in Squiz.Strings.ConcatenationSpacing during live coding
      • Thanks to Thiemo Kreuz for the patch
    • πŸ›  Fixed bug #2989 : Incorrect auto-fixing in Generic.ControlStructures.InlineControlStructure during live coding
      • Thanks to Thiemo Kreuz for the patch
    • πŸ›  Fixed bug #3007 : Directory exclude pattern improperly excludes directories with names that start the same
      • Thanks to Steve Talbot for the patch
    • πŸ›  Fixed bug #3043 : Squiz.WhiteSpace.OperatorSpacing false positive for negation in arrow function
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #3049 : Incorrect error with arrow function and parameter passed as reference
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #3053 : PSR2 incorrect fix when multiple use statements on same line do not have whitespace between them
    • πŸ›  Fixed bug #3058 : Progress gets unaligned when 100% happens at the end of the available dots
    • πŸ›  Fixed bug #3059 : Squiz.Arrays.ArrayDeclaration false positive when using type casting
      • Thanks to Sergei Morozov for the patch
    • πŸ›  Fixed bug #3060 : Squiz.Arrays.ArrayDeclaration false positive for static functions
      • Thanks to Sergei Morozov for the patch
    • πŸ›  Fixed bug #3065 : Should not fix Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma if comment between element and comma
      • Thanks to Sergei Morozov for the patch
    • πŸ›  Fixed bug #3066 : No support for namespace operator used in type declarations
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #3075 : PSR12.ControlStructures.BooleanOperatorPlacement false positive when operator is the only content on line
    • πŸ›  Fixed bug #3099 : Squiz.WhiteSpace.OperatorSpacing false positive when exiting with negative number
      • Thanks to Sergei Morozov for the patch
    • πŸ›  Fixed bug #3102 : PSR12.Squiz.OperatorSpacing false positive for default values of arrow functions
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #3124 : PSR-12 not reporting error for empty lines with only whitespace
    • πŸ›  Fixed bug #3135 : Ignore annotations are broken on PHP 8.0
      • Thanks to Juliette Reinders Folmer for the patch
  • v3.5.6 Changes

    August 10, 2020
    • βž• Added support for PHP 8.0 magic constant dereferencing
      • Thanks to Juliette Reinders Folmer for the patch
    • βž• Added support for changes to the way PHP 8.0 tokenizes comments
      • The existing PHP 5-7 behaviour has been replicated for version 8, so no sniff changes are required
      • Thanks to Juliette Reinders Folmer for the patch
    • File::getMethodProperties() now detects the PHP 8.0 static return type
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ‘ The PHP 8.0 static return type is now supported for arrow functions
      • Thanks to Juliette Reinders Folmer for the patch
    • The cache is no longer used if the list of loaded PHP extensions changes
      • Thanks to Juliette Reinders Folmer for the patch
    • Generic.NamingConventions.CamelCapsFunctionName no longer reports __serialize and __ unserialize as invalid names
      • Thanks to Filip Ε  for the patch
    • PEAR.NamingConventions.ValidFunctionName no longer reports __serialize and __ unserialize as invalid names
      • Thanks to Filip Ε  for the patch
    • Squiz.Scope.StaticThisUsage now detects usage of $this inside closures and arrow functions
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ›  Fixed bug #2877 : PEAR.Functions.FunctionCallSignature false positive for array of functions
      • Thanks to Vincent Langlet for the patch
    • πŸ›  Fixed bug #2888 : PSR12.Files.FileHeader blank line error with multiple namespaces in one file
    • πŸ›  Fixed bug #2926 : phpcs hangs when using arrow functions that return heredoc
    • πŸ›  Fixed bug #2943 : Redundant semicolon added to a file when fixing PSR2.Files.ClosingTag.NotAllowed
    • πŸ›  Fixed bug #2967 : Markdown generator does not output headings correctly
      • Thanks to Petr BugyΓ­k for the patch
    • πŸ›  Fixed bug #2977 : File::isReference() does not detect return by reference for closures
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2994 : Generic.Formatting.DisallowMultipleStatements false positive for FOR loop with no body
    • πŸ›  Fixed bug #3033 : Error generated during tokenizing of goto statements on PHP 8
      • Thanks to Juliette Reinders Folmer for the patch
  • v3.5.5 Changes

    April 17, 2020
    • The T_FN backfill now works more reliably so T_FN tokens only ever represent real arrow functions
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed an issue where including sniffs using paths containing multiple dots would silently fail
    • Generic.CodeAnalysis.EmptyPHPStatement now detects empty statements at the start of control structures
    • Error wording in PEAR.Functions.FunctionCallSignature now always uses "parenthesis" instead of sometimes using "bracket"
      • Thanks to Vincent Langlet for the patch
    • πŸ›  Fixed bug #2787 : Squiz.PHP.DisallowMultipleAssignments not ignoring typed property declarations
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2810 : PHPCBF fails to fix file with empty statement at start on control structure
    • πŸ›  Fixed bug #2812 : Squiz.Arrays.ArrayDeclaration not detecting some arrays with multiple arguments on the same line
      • Thanks to Jakub ChΓ‘bek for the patch
    • πŸ›  Fixed bug #2826 : Generic.WhiteSpace.ArbitraryParenthesesSpacing doesn't detect issues for statements directly after a control structure
      • Thanks to Vincent Langlet for the patch
    • πŸ›  Fixed bug #2848 : PSR12.Files.FileHeader false positive for file with mixed PHP and HTML and no file header
    • πŸ›  Fixed bug #2849 : Generic.WhiteSpace.ScopeIndent false positive with arrow function inside array
    • Fixed bug #2850 : Generic.PHP.LowerCaseKeyword complains __HALT_COMPILER is uppercase
    • πŸ›  Fixed bug #2853 : Undefined variable error when using Info report
      • Thanks to Juliette Reinders Folmer for the patch
    • Fixed bug #2865 : Double arrow tokenized as T_STRING when placed after function named "fn"
    • πŸ›  Fixed bug #2867 : Incorrect scope matching when arrow function used inside IF condition
    • πŸ›  Fixed bug #2868 : phpcs:ignore annotation doesnt work inside a docblock
    • πŸ›  Fixed bug #2878 : PSR12.Files.FileHeader conflicts with Generic.Files.LineEndings
    • πŸ›  Fixed bug #2895 : PSR2.Methods.FunctionCallSignature.MultipleArguments false positive with arrow function argument
  • v3.5.4 Changes

    January 30, 2020
    • The PHP 7.4 numeric separator backfill now works correctly for more float formats
      • Thanks to Juliette Reinders Folmer for the patch
    • The PHP 7.4 numeric separator backfill is no longer run on PHP version 7.4.0 or greater
    • File::getCondition() now accepts a 3rd argument that allows for the closest matching token to be returned
      • By default, it continues to return the first matched token found from the top of the file
    • πŸ›  Fixed detection of array return types for arrow functions
    • βž• Added Generic.PHP.DisallowRequestSuperglobal to ban the use of the $_REQUEST superglobal
      • Thanks to Morerice for the contribution
    • Generic.ControlStructures.InlineControlStructure no longer shows errors for while and for statements without a body
      • Previously it required these to have curly braces, but there were no statements to enclose in them
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ”§ PSR12.ControlStructures.BooleanOperatorPlacement can now be configured to enforce a specific operator position
      • By default, the sniff ensures that operators are all at the beginning or end of lines, but not a mix of both
      • Set the allowOnly property to first to enforce all boolean operators to be at the start of a line
      • Set the allowOnly property to last to enforce all boolean operators to be at the end of a line
      • Thanks to Vincent Langlet for the patch
    • πŸ›  PSR12.Files.ImportStatement now auto-fixes import statements by removing the leading slash
      • Thanks to MichaΕ‚ Bundyra for the patch
    • Squiz.ControlStructures.ForLoopDeclaration now has a setting to ignore newline characters
      • Default remains FALSE, so newlines are not allowed within for definitions
      • Override the ignoreNewlines setting in a ruleset.xml file to change
    • Squiz.PHP.InnerFunctions now handles multiple nested anon classes correctly
    • πŸ›  Fixed bug #2497 : Sniff properties not set when referencing a sniff using relative paths or non-native slashes
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2657 : Squiz.WhiteSpace.FunctionSpacing can remove spaces between comment and first/last method during auto-fixing
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2688 : Case statements not tokenized correctly when switch is contained within ternary
    • Fixed bug #2698 : PHPCS throws errors determining auto report width when shell_exec is disabled
      • Thanks to Matthew Peveler for the patch
    • πŸ›  Fixed bug #2730 : PSR12.ControlStructures.ControlStructureSpacing does not ignore comments between conditions
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2732 : PSR12.Files.FileHeader misidentifies file header in mixed content file
    • πŸ›  Fixed bug #2745 : AbstractArraySniff wrong indices when mixed coalesce and ternary values
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ›  Fixed bug #2748 : Wrong end of statement for fn closures
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ›  Fixed bug #2751 : Autoload relative paths first to avoid confusion with files from the global include path
      • Thanks to Klaus Purer for the patch
    • πŸ›  Fixed bug #2763 : PSR12 standard reports errors for multi-line FOR definitions
    • πŸ›  Fixed bug #2768 : Generic.Files.LineLength false positive for non-breakable strings at exactly the soft limit
      • Thanks to Alex Miles for the patch
    • πŸ›  Fixed bug #2773 : PSR2.Methods.FunctionCallSignature false positive when arrow function has array return type
    • πŸ›  Fixed bug #2790 : PSR12.Traits.UseDeclaration ignores block comments
      • Thanks to Vincent Langlet for the patch
    • πŸ›  Fixed bug #2791 : PSR12.Functions.NullableTypeDeclaration false positive when ternary operator used with instanceof
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2802 : Can't specify a report file path using the tilde shortcut
    • πŸ›  Fixed bug #2804 : PHP4-style typed properties not tokenized correctly
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2805 : Undefined Offset notice during live coding of arrow functions
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2843 : Tokenizer does not support alternative syntax for declare statements
      • Thanks to Juliette Reinders Folmer for the patch
  • v3.5.3 Changes

    December 04, 2019
    • The PHP 7.4 T_FN token has been made available for older versions
      • T_FN represents the fn string used for arrow functions
      • The double arrow becomes the scope opener, and uses a new T_FN_ARROW token type
      • The token after the statement (normally a semicolon) becomes the scope closer
      • The token is also associated with the opening and closing parenthesis of the statement
      • Any functions named fn will have a T_FN token for the function name, but have no scope information
      • Thanks to MichaΕ‚ Bundyra for the help with this change
    • PHP 7.4 numeric separators are now tokenized in the same way when using older PHP versions
      • Previously, a number like 1_000 would tokenize as T_LNUMBER (1), T_STRING (_000)
      • Now, the number tokenizes as T_LNUMBER (1_000)
      • Sniff developers should consider how numbers with underscores impact their custom sniffs
    • The PHPCS file cache now takes file permissions into account
      • The cache is now invalidated for a file when its permissions are changed
    • πŸ‘ File::getMethodParameters() now supports arrow functions
    • πŸ‘ File::getMethodProperties() now supports arrow functions
    • βž• Added Fixer::changeCodeBlockIndent() to change the indent of a code block while auto-fixing
      • Can be used to either increase or decrease the indent
      • Useful when moving the start position of something like a closure, where you want the content to also move
    • βž• Added Generic.Files.ExecutableFile sniff
      • Ensures that files are not executable
      • Thanks to Matthew Peveler for the contribution
    • Generic.CodeAnalysis.EmptyPhpStatement now reports unnecessary semicolons after control structure closing braces
      • Thanks to Vincent Langlet for the patch
    • Generic.PHP.LowerCaseKeyword now enforces that the fn keyword is lowercase
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ‘ Generic.WhiteSpace.ScopeIndent now supports static arrow functions
    • PEAR.Functions.FunctionCallSignature now adjusts the indent of function argument contents during auto-fixing
      • Previously, only the first line of an argument was changed, leading to inconsistent indents
      • This change also applies to PSR2.Methods.FunctionCallSignature
    • PSR2.ControlStructures.ControlStructureSpacing now checks whitespace before the closing parenthesis of multi-line control structures
      • Previously, it incorrectly applied the whitespace check for single-line definitions only
    • PSR12.Functions.ReturnTypeDeclaration now checks the return type of arrow functions
      • Thanks to MichaΕ‚ Bundyra for the patch
    • PSR12.Traits.UseDeclaration now ensures all trait import statements are grouped together
      • Previously, the trait import section of the class ended when the first non-import statement was found
      • Checking now continues throughout the class to ensure all statements are grouped together
      • This also ensures that empty lines are not requested after an import statement that isn't the last one
    • Squiz.Functions.LowercaseFunctionKeywords now enforces that the fn keyword is lowercase
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ›  Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop
    • πŸ›  Fixed bug #2638 : Squiz.CSS.DuplicateClassDefinitionSniff sees comments as part of the class name
      • Thanks to Raphael Horber for the patch
    • πŸ›  Fixed bug #2640 : Squiz.WhiteSpace.OperatorSpacing false positives for some negation operators
      • Thanks to Jakub ChΓ‘bek and Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message
    • πŸ›  Fixed bug #2676 : PSR12.Files.FileHeader locks up when file ends with multiple inline comments
    • πŸ›  Fixed bug #2678 : PSR12.Classes.AnonClassDeclaration incorrectly enforcing that closing brace be on a line by itself
    • πŸ›  Fixed bug #2685 : File::getMethodParameters() setting typeHintEndToken for vars with no type hint
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2694 : AbstractArraySniff produces invalid indices when using ternary operator
      • Thanks to MichaΕ‚ Bundyra for the patch
    • πŸ›  Fixed bug #2702 : Generic.WhiteSpace.ScopeIndent false positive when using ternary operator with short arrays
  • v3.5.2 Changes

    October 28, 2019
    • Generic.ControlStructures.DisallowYodaConditions now returns less false positives
      • False positives were being returned for array comparisions, or when performing some function calls
    • Squiz.WhiteSpace.SemicolonSpacing.Incorrect error message now escapes newlines and tabs
      • Provides a clearer error message as whitespace is now visible
      • Also allows for better output for report types such as CSV and XML
    • The error message for PSR12.Files.FileHeader.SpacingAfterBlock has been made clearer
      • It now uses the wording from the published PSR-12 standard to indicate that blocks must be separated by a blank line
      • Thanks to Craig Duncan for the patch
    • πŸ›  Fixed bug #2654 : Incorrect indentation for arguments of multiline function calls
    • πŸ›  Fixed bug #2656 : Squiz.WhiteSpace.MemberVarSpacing removes comments before first member var during auto fixing
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2663 : Generic.NamingConventions.ConstructorName complains about old constructor in interfaces
    • πŸ›  Fixed bug #2664 : PSR12.Files.OpenTag incorrectly identifies PHP file with only an opening tag
    • πŸ›  Fixed bug #2665 : PSR12.Files.ImportStatement should not apply to traits
    • πŸ›  Fixed bug #2673 : PSR12.Traits.UseDeclaration does not allow comments or blank lines between use statements
  • v3.5.1 Changes

    October 16, 2019
    • Very very verbose diff report output has slightly changed to improve readability
      • Output is printed when running PHPCS with the --report=diff and -vvv command line arguments
      • Fully qualified class names have been replaced with sniff codes
      • Tokens being changed now display the line number they are on
    • PSR2, PSR12, and PEAR standards now correctly check for blank lines at the start of function calls
      • This check has been missing from these standards, but has now been implemented
      • When using the PEAR standard, the error code is PEAR.Functions.FunctionCallSignature.FirstArgumentPosition
      • When using PSR2 or PSR12, the error code is PSR2.Methods.FunctionCallSignature.FirstArgumentPosition
    • PSR12.ControlStructures.BooleanOperatorPlacement no longer complains when multiple expressions appear on the same line
      • Previously, boolean operators were enforced to appear at the start or end of lines only
      • Boolean operators can now appear in the middle of the line
    • PSR12.Files.FileHeader no longer ignores comments preceding a use, namespace, or declare statement
    • PSR12.Files.FileHeader now allows a hashbang line at the top of the file
    • πŸ›  Fixed bug #2506 : PSR2 standard can't auto fix multi-line function call inside a string concat statement
    • πŸ›  Fixed bug #2530 : PEAR.Commenting.FunctionComment does not support intersection types in comments
    • πŸ›  Fixed bug #2615 : Constant visibility false positive on non-class constants
    • πŸ›  Fixed bug #2616 : PSR12.Files.FileHeader false positive when file only contains docblock
    • πŸ›  Fixed bug #2619 : PSR12.Files.FileHeader locks up when inline comment is the last content in a file
    • πŸ›  Fixed bug #2621 : PSR12.Classes.AnonClassDeclaration.CloseBraceSameLine false positive for anon class passed as function argument
      • Thanks to Martins Sipenko for the patch
    • πŸ›  Fixed bug #2623 : PSR12.ControlStructures.ControlStructureSpacing not ignoring indentation inside multi-line string arguments
    • πŸ›  Fixed bug #2624 : PSR12.Traits.UseDeclaration doesnt apply the correct indent during auto fixing
    • πŸ›  Fixed bug #2626 : PSR12.Files.FileHeader detects @var annotations as file docblocks
    • πŸ›  Fixed bug #2628 : PSR12.Traits.UseDeclaration does not allow comments above a USE declaration
    • πŸ›  Fixed bug #2632 : Incorrect indentation of lines starting with "static" inside closures
    • πŸ›  Fixed bug #2641 : PSR12.Functions.NullableTypeDeclaration false positive when using new static()
  • v3.5.0 Changes

    September 26, 2019

    PSR-12 Standard Ready

    πŸš€ PHP_CodeSniffer has included an in-progress PSR-12 standard since 3.3.0, but this release includes the completed standard. You can now check your code using the PSR-12 standard:

    phpcs --standard=PSR12 /path/to/code
    

    πŸ›  Most of the errors found can also be automatically fixed by PHPCBF:

    phpcbf --standard=PSR12 /path/to/code
    

    πŸ”„ Changelog

    • βž• Added support for PHP 7.4 typed properties
      • The nullable operator is now tokenized as T_NULLABLE inside property types, as it is elsewhere
      • To get the type of a member var, use the File::getMemberProperties() method, which now contains a type array index
      • This contains the type of the member var, or a blank string if not specified
      • If the type is nullable, the return type will contain the leading ?
      • If a type is specified, the position of the first token in the type will be set in a type_token array index
      • If a type is specified, the position of the last token in the type will be set in a type_end_token array index
      • If the type is nullable, a nullable_type array index will also be set to TRUE
      • If the type contains namespace information, it will be cleaned of whitespace and comments in the return value
    • The PSR1 standard now correctly bans alternate PHP tags
      • Previously, it only banned short open tags and not the pre-7.0 alternate tags
    • βž• Added support for only checking files that have been locally staged in a git repo
      • Use --filter=gitstaged to check these files
      • You still need to give PHPCS a list of files or directories in which to apply the filter
      • Thanks to Juliette Reinders Folmer for the contribution
    • JSON reports now end with a newline character
    • The phpcs.xsd schema now validates phpcs-only and phpcbf-only attributes correctly
      • Thanks to Juliette Reinders Folmer for the patch
    • The tokenizer now correctly identifies inline control structures in more cases
    • All helper methods inside the File class now throw RuntimeException instead of TokenizerException
      • Some tokenizer methods were also throwing RuntimeExpection but now correctly throw TokenizerException
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ‘ The File::getMethodParameters() method now returns more information, and supports closure USE groups
      • If a type hint is specified, the position of the last token in the hint will be set in a type_hint_end_token array index
      • If a default is specified, the position of the first token in the default value will be set in a default_token array index
      • If a default is specified, the position of the equals sign will be set in a default_equal_token array index
      • If the param is not the last, the position of the comma will be set in a comma_token array index
      • If the param is passed by reference, the position of the reference operator will be set in a reference_token array index
      • If the param is variable length, the position of the variadic operator will be set in a variadic_token array index
    • The T_LIST token and it's opening and closing parentheses now contain references to each other in the tokens array
      • Uses the same parenthesis_opener/closer/owner indexes as other tokens
      • Thanks to Juliette Reinders Folmer for the patch
    • The T_ANON_CLASS token and it's opening and closing parentheses now contain references to each other in the tokens array
      • Uses the same parenthesis_opener/closer/owner indexes as other tokens
      • Only applicable if the anon class is passing arguments to the constructor
      • Thanks to Juliette Reinders Folmer for the patch
    • The PHP 7.4 T_BAD_CHARACTER token has been made available for older versions
      • Allows you to safely look for this token, but it will not appear unless checking with PHP 7.4+
    • Metrics are now available for Squiz.WhiteSpace.FunctionSpacing
      • Use the info report to see blank lines before/after functions
      • Thanks to Juliette Reinders Folmer for the patch
    • Metrics are now available for Squiz.WhiteSpace.MemberVarSpacing
      • Use the info report to see blank lines before member vars
      • Thanks to Juliette Reinders Folmer for the patch
    • βž• Added Generic.ControlStructures.DisallowYodaConditions sniff
      • Ban the use of Yoda conditions
      • Thanks to Mponos George for the contribution
    • βž• Added Generic.PHP.RequireStrictTypes sniff
      • Enforce the use of a strict types declaration in PHP files
    • βž• Added Generic.WhiteSpace.SpreadOperatorSpacingAfter sniff
      • Checks whitespace between the spread operator and the variable/function call it applies to
      • Thanks to Juliette Reinders Folmer for the contribution
    • βž• Added PSR12.Classes.AnonClassDeclaration sniff
      • Enforces the formatting of anonymous classes
    • βž• Added PSR12.Classes.ClosingBrace sniff
      • Enforces that closing braces of classes/interfaces/traits/functions are not followed by a comment or statement
    • βž• Added PSR12.ControlStructures.BooleanOperatorPlacement sniff
      • Enforces that boolean operators between conditions are consistently at the start or end of the line
    • βž• Added PSR12.ControlStructures.ControlStructureSpacing sniff
      • Enforces that spacing and indents are correct inside control structure parenthesis
    • βž• Added PSR12.Files.DeclareStatement sniff
      • Enforces the formatting of declare statements within a file
    • βž• Added PSR12.Files.FileHeader sniff
      • Enforces the order and formatting of file header blocks
    • βž• Added PSR12.Files.ImportStatement sniff
      • Enforces the formatting of import statements within a file
    • βž• Added PSR12.Files.OpenTag sniff
      • Enforces that the open tag is on a line by itself when used at the start of a php-only file
    • βž• Added PSR12.Functions.ReturnTypeDeclaration sniff
      • Enforces the formatting of return type declarations in functions and closures
    • βž• Added PSR12.Properties.ConstantVisibility sniff
      • Enforces that constants must have their visibility defined
      • Uses a warning instead of an error due to this conditionally requiring the project to support PHP 7.1+
    • βž• Added PSR12.Traits.UseDeclaration sniff
      • Enforces the formatting of trait import statements within a class
    • Generic.Files.LineLength ignoreComments property now ignores comments at the end of a line
      • Previously, this property was incorrectly causing the sniff to ignore any line that ended with a comment
      • Now, the trailing comment is not included in the line length, but the rest of the line is still checked
    • Generic.Files.LineLength now only ignores unwrappable comments when the comment is on a line by itself
      • Previously, a short unwrappable comment at the end of the line would have the sniff ignore the entire line
    • Generic.Functions.FunctionCallArgumentSpacing no longer checks spacing around assignment operators inside function calls
      • Use the Squiz.WhiteSpace.OperatorSpacing sniff to enforce spacing around assignment operators
      • Note that this sniff checks spacing around all assignment operators, not just inside function calls
      • The Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals error has been removed
      • use Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore instead
      • The Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterEquals error has been removed
      • use Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfter instead
      • This also changes the PEAR/PSR2/PSR12 standards so they no longer check assignment operators inside function calls
      • They were previously checking these operators when they should not have
      • Thanks to Juliette Reinders Folmer for the patch
    • Generic.WhiteSpace.ScopeIndent no longer performs exact indents checking for chained method calls
      • Other sniffs can be used to enforce chained method call indent rules
      • Thanks to Pieter Frenssen for the patch
    • πŸ‘ PEAR.WhiteSpace.ObjectOperatorIndent now supports multi-level chained statements
      • When enabled, chained calls must be indented 1 level more or less than the previous line
      • Set the new multilevel setting to TRUE in a ruleset.xml file to enable this behaviour
      • Thanks to Marcos Passos for the patch
    • PSR2.ControlStructures.ControlStructureSpacing now allows whitespace after the opening parenthesis if followed by a comment
      • Thanks to MichaΕ‚ Bundyra for the patch
    • PSR2.Classes.PropertyDeclaration now enforces a single space after a property type keyword
      • The PSR2 standard itself excludes this new check as it is not defined in the written standard
      • Using the PSR12 standard will enforce this check
    • Squiz.Commenting.BlockComment no longer requires blank line before comment if it's the first content after the PHP open tag
      • Thanks to Juliette Reinders Folmer for the patch
    • Squiz.Functions.FunctionDeclarationArgumentSpacing now has more accurate error messages
      • This includes renaming the SpaceAfterDefault error code to SpaceAfterEquals, which reflects the real error
    • Squiz.Functions.FunctionDeclarationArgumentSpacing now checks for no space after a reference operator
      • If you don't want this new behaviour, exclude the SpacingAfterReference error message in a ruleset.xml file
    • Squiz.Functions.FunctionDeclarationArgumentSpacing now checks for no space after a variadic operator
      • If you don't want this new behaviour, exclude the SpacingAfterVariadic error message in a ruleset.xml file
    • Squiz.Functions.MultiLineFunctionDeclaration now has improved fixing for the FirstParamSpacing and UseFirstParamSpacing errors
    • Squiz.Operators.IncrementDecrementUsage now suggests pre-increment of variables instead of post-increment
      • This change does not enforce pre-increment over post-increment; only the suggestion has changed
      • Thanks to Juliette Reinders Folmer for the patch
    • Squiz.PHP.DisallowMultipleAssignments now has a second error code for when assignments are found inside control structure conditions
      • The new error code is Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
      • All other multiple assignment cases use the existing error code Squiz.PHP.DisallowMultipleAssignments.Found
      • Thanks to Juliette Reinders Folmer for the patch
    • Squiz.WhiteSpace.FunctionSpacing now applies beforeFirst and afterLast spacing rules to nested functions
      • Previously, these rules only applied to the first and last function in a class, interface, or trait
      • These rules now apply to functions nested in any statement block, including other functions and conditions
    • πŸ“œ Squiz.WhiteSpace.OperatorSpacing now has improved handling of parse errors
      • Thanks to Juliette Reinders Folmer for the patch
    • Squiz.WhiteSpace.OperatorSpacing now checks spacing around the instanceof operator
      • Thanks to Jakub ChΓ‘bek for the patch
    • Squiz.WhiteSpace.OperatorSpacing can now enforce a single space before assignment operators
      • Previously, the sniff this spacing as multiple assignment operators are sometimes aligned
      • Now, you can set the ignoreSpacingBeforeAssignments sniff property to FALSE to enable checking
      • Default remains TRUE, so spacing before assignments is not checked by default
      • Thanks to Jakub ChΓ‘bek for the patch
    • πŸ›  Fixed bug #2391 : Sniff-specific ignore rules inside rulesets are filtering out too many files
      • Thanks to Juliette Reinders Folmer and Willington Vega for the patch
    • πŸ›  Fixed bug #2478 : FunctionCommentThrowTag.WrongNumber when exception is thrown once but built conditionally
    • πŸ›  Fixed bug #2479 : Generic.WhiteSpace.ScopeIndent error when using array destructing with exact indent checking
    • πŸ›  Fixed bug #2498 : Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed autofix breaks heredoc
    • πŸ›  Fixed bug #2502 : Generic.WhiteSpace.ScopeIndent false positives with nested switch indentation and case fall-through
    • πŸ›  Fixed bug #2504 : Generic.WhiteSpace.ScopeIndent false positives with nested arrays and nowdoc string
    • πŸ›  Fixed bug #2511 : PSR2 standard not checking if closing paren of single-line function declaration is on new line
    • πŸ›  Fixed bug #2512 : Squiz.PHP.NonExecutableCode does not support alternate SWITCH control structure
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2522 : Text generator throws error when code sample line is too long
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2526 : XML report format has bad syntax on Windows
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2529 : Generic.Formatting.MultipleStatementAlignment wrong error for assign in string concat
    • Fixed bug #2534 : Unresolvable installed_paths can lead to open_basedir errors
      • Thanks to Oliver Nowak for the patch
    • πŸ›  Fixed bug #2541 : Text doc generator does not allow for multi-line rule explanations
      • Thanks to Juliette Reinders Folmer for the patch
    • ⚠ Fixed bug #2549 : Searching for a phpcs.xml file can throw warnings due to open_basedir restrictions
      • Thanks to Matthew Peveler for the patch
    • πŸ›  Fixed bug #2558 : PHP 7.4 throwing offset syntax with curly braces is deprecated message
      • Thanks to Matthew Peveler for the patch
    • πŸ›  Fixed bug #2561 : PHP 7.4 compatibility fix / implode argument order
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2562 : Inline WHILE triggers SpaceBeforeSemicolon incorrectly
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2565 : Generic.ControlStructures.InlineControlStructure confused by mixed short/long tags
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2566 : Author tag email validation doesn't support all TLDs
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2575 : Custom error messages don't have data replaced when cache is enabled
    • πŸ›  Fixed bug #2601 : Squiz.WhiteSpace.FunctionSpacing incorrect fix when spacing is 0
    • πŸ›  Fixed bug #2608 : PSR2 throws errors for use statements when multiple namespaces are defined in a file
  • v3.4.2 Changes

    April 11, 2019
    • Squiz.Arrays.ArrayDeclaration now has improved handling of syntax errors
    • πŸ›  Fixed an issue where the PCRE JIT on PHP 7.3 caused PHPCS to die when using the parallel option
      • PHPCS now disables the PCRE JIT before running
    • πŸ›  Fixed bug #2368 : MySource.PHP.AjaxNullComparison throws error when first function has no doc comment
    • πŸ›  Fixed bug #2414 : Indention false positive in switch/case/if combination
    • πŸ›  Fixed bug #2423 : Squiz.Formatting.OperatorBracket.MissingBrackets error with static
    • πŸ›  Fixed bug #2450 : Indentation false positive when closure containing nested IF conditions used as function argument
    • πŸ›  Fixed bug #2452 : LowercasePHPFunctions sniff failing on "new \File()"
    • πŸ›  Fixed bug #2453 : Squiz.CSS.SemicolonSpacingSniff false positive when style name proceeded by an asterisk
      • Thanks to Juliette Reinders Folmer for the patch
    • πŸ›  Fixed bug #2464 : Fixer conflict between Generic.WhiteSpace.ScopeIndent and Squiz.WhiteSpace.ScopeClosingBrace when class indented 1 space
    • πŸ›  Fixed bug #2465 : Excluding a sniff by path is not working
    • πŸ›  Fixed bug #2467 : PHP open/close tags inside CSS files are replaced with internal PHPCS token strings when auto fixing