Skip to content

Commit 1e2488c

Browse files
author
Vincent Langlet
committed
✨ Do not check for tearDown function comments
1 parent 3aa2427 commit 1e2488c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ In Sniff/WhiteSpace/FunctionalClosingBraceSniff:
5858

5959
In Sniff/Commenting/FunctionCommentSniff:
6060
- check for 1 blank line above a docblock
61-
- don't check docblocks for test and setUp methods (PHPunit, would be blank)
61+
- don't check docblocks for test, setUp and tearDown methods (PHPunit, would be blank)
6262
- do check protected and private methods for docblocks
6363

6464
In Sniff/NamingConventions/ValidClassNameSniff

Symfony3Custom/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
6767

6868
$name = $phpcsFile->getDeclarationName($stackPtr);
6969

70-
$commentRequired = strpos($name, 'test') !== 0 && $name !== 'setUp';
70+
$commentRequired = strpos($name, 'test') !== 0 && $name !== 'setUp' && $name !== 'tearDown';
7171

7272
if (($code === T_COMMENT && !$commentRequired)
7373
|| ($code !== T_DOC_COMMENT && !$commentRequired)

0 commit comments

Comments
 (0)