@@ -57,6 +57,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
5757
5858 if ($ commentRequired ) {
5959 $ phpcsFile ->addError ('Missing function doc comment ' , $ stackPtr , 'Missing ' );
60+
6061 return ;
6162 } else {
6263 // The comment may not be required, we'll see in next checks
@@ -69,7 +70,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
6970 $ commentStart = null ;
7071 if ($ hasComment ) {
7172 if ($ tokens [$ commentEnd ]['code ' ] === T_COMMENT ) {
72- $ phpcsFile ->addError ('You must use "/**" style comments for a function comment ' , $ stackPtr , 'WrongStyle ' );
73+ $ phpcsFile ->addError (
74+ 'You must use "/**" style comments for a function comment ' ,
75+ $ stackPtr ,
76+ 'WrongStyle '
77+ );
7378
7479 return ;
7580 }
@@ -192,7 +197,7 @@ protected function processWhitespace(
192197 $ found = $ startLine - $ prevLine - 1 ;
193198
194199 // Skip for class opening
195- if ($ found !== 1 && !($ found === 0 && $ tokens [$ before ]['type ' ] === 'T_OPEN_CURLY_BRACKET ' )) {
200+ if ($ found < 1 && !($ found === 0 && $ tokens [$ before ]['type ' ] === 'T_OPEN_CURLY_BRACKET ' )) {
196201 if ($ found < 0 ) {
197202 $ found = 0 ;
198203 }
@@ -241,8 +246,6 @@ protected function processWhitespace(
241246 */
242247 protected function isInheritDoc (PHP_CodeSniffer_File $ phpcsFile , $ stackPtr )
243248 {
244- $ tokens = $ phpcsFile ->getTokens ();
245-
246249 $ start = $ phpcsFile ->findPrevious (T_DOC_COMMENT_OPEN_TAG , $ stackPtr - 1 );
247250 $ end = $ phpcsFile ->findNext (T_DOC_COMMENT_CLOSE_TAG , $ start );
248251
@@ -267,8 +270,6 @@ protected function processParams(
267270 $ stackPtr ,
268271 $ commentStart
269272 ) {
270- $ tokens = $ phpcsFile ->getTokens ();
271-
272273 if ($ this ->isInheritDoc ($ phpcsFile , $ stackPtr )) {
273274 return ;
274275 }
0 commit comments