Skip to content

Commit

Permalink
Fixed bug squizlabs#485 : PHP notice in Squiz.Commenting.FunctionComm…
Browse files Browse the repository at this point in the history
…ent when checking malformed @throws comment
  • Loading branch information
gsherwood committed Feb 10, 2015
1 parent 5cddfb3 commit 74170c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function processThrows(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co
$matches = array();
preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches);
$exception = $matches[1];
if (isset($matches[2]) === true) {
if (isset($matches[2]) === true && trim($matches[2]) !== '') {
$comment = $matches[2];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,4 +660,12 @@ class Baz {
public function __construct() {

}
}
}

/**
* Test
*
* @return void
* @throws E
*/
function myFunction() {}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function getErrorList()
526 => 1,
548 => 1,
641 => 1,
669 => 1,
);

}//end getErrorList()
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #457 : FunctionCallSignature sniffs do not support here/nowdoc syntax and can cause syntax error when fixing
- Fixed bug #466 : PropertyLabelSpacing JS fixer issue when there is no space after colon
- Fixed bug #473 : Writing a report for an empty folder to existing file includes the existing contents
- Fixed bug #485 : PHP notice in Squiz.Commenting.FunctionComment when checking malformed @throws comment
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit 74170c1

Please sign in to comment.