diff --git a/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php index 60d43d30c4..c1dc37c90c 100644 --- a/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ b/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -97,8 +97,10 @@ protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co } } - // Ignores description, that might come after return type. - list($returnType,) = explode(' ', $content, 2); + // Support both a return type and a description. The return type + // is anything up to the first space. + $returnParts = explode(' ', $content, 2); + $returnType = $returnParts[0]; // If the return type is void, make sure there is // no return statement in the function. diff --git a/package.xml b/package.xml index 06fe58413e..df58f1f01e 100644 --- a/package.xml +++ b/package.xml @@ -49,6 +49,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> - Fixed bug #983 : Squiz.WhiteSpace.MemberVarSpacing.AfterComment fails to fix error when comment is not a docblock - Fixed bug #1010 : Squiz NonExectuableCode sniff does not detect boolean OR -- Thanks to Derek Henderson for the patch + - Fixed bug #1015 : The Squiz.Commenting.FunctionComment sniff doesn't allow description in @return tag + -- Thanks to Alexander Obuhovich for the patch