From 62f50014af37409189dab8727935bb8d58e5f906 Mon Sep 17 00:00:00 2001 From: Greg Sherwood Date: Tue, 29 Oct 2019 08:16:13 +1100 Subject: [PATCH] Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message --- package.xml | 20 +++---------------- src/Config.php | 2 +- ...unctionDeclarationArgumentSpacingSniff.php | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/package.xml b/package.xml index 92c45d5630..c2d41a2160 100644 --- a/package.xml +++ b/package.xml @@ -17,8 +17,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> 2019-10-28 - 3.5.2 - 3.5.2 + 3.5.3 + 3.5.3 stable @@ -26,21 +26,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> BSD 3-Clause License - - 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 + - Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message diff --git a/src/Config.php b/src/Config.php index 53f6adadb0..f0f3a0c2f2 100644 --- a/src/Config.php +++ b/src/Config.php @@ -23,7 +23,7 @@ class Config * * @var string */ - const VERSION = '3.5.2'; + const VERSION = '3.5.3'; /** * Package stability; either stable, beta or alpha. diff --git a/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php index d42f6c331c..9977867d41 100644 --- a/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php @@ -259,7 +259,7 @@ public function processBracket($phpcsFile, $openBracket) if ($tokens[($commaToken - 1)]['code'] === T_WHITESPACE) { $error = 'Expected 0 spaces between argument "%s" and comma; %s found'; $data = [ - $param['name'], + $params[($paramNumber - 1)]['name'], $tokens[($commaToken - 1)]['length'], ];