Skip to content

Commit

Permalink
Fixed bug #3503 : Squiz.Commenting.FunctionComment.ThrowsNoFullStop f…
Browse files Browse the repository at this point in the history
…alse positive when one line @throw
  • Loading branch information
gsherwood committed Dec 20, 2021
1 parent c715f09 commit f653fd2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Squiz.Commenting.DocCommentAlignment
-- Squiz.Commenting.VariableComment
-- Thanks to Juliette Reinders Folmer for the patches
- Fixed bug #3503 : Squiz.Commenting.FunctionComment.ThrowsNoFullStop false positive when one line @throw
</notes>
<contents>
<dir name="/">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ protected function processThrows(File $phpcsFile, $stackPtr, $commentStart)
}
}

$comment = trim($comment);

// Starts with a capital letter and ends with a fullstop.
$firstChar = $comment[0];
if (strtoupper($firstChar) !== $firstChar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1041,3 +1041,8 @@ public function ignored() {
}

// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct

/**
* @return void
* @throws Exception If any other error occurs. */
function throwCommentOneLine() {}
Original file line number Diff line number Diff line change
Expand Up @@ -1041,3 +1041,8 @@ public function ignored() {
}

// phpcs:set Squiz.Commenting.FunctionComment specialMethods[] __construct,__destruct

/**
* @return void
* @throws Exception If any other error occurs. */
function throwCommentOneLine() {}

0 comments on commit f653fd2

Please sign in to comment.