Skip to content

Commit 647fe0a

Browse files
committed
Fix false positive.
1 parent f173a97 commit 647fe0a

15 files changed

+142
-133
lines changed

PSR2R/Sniffs/Commenting/DocBlockEndingSniff.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
*/
1515
class DocBlockEndingSniff implements Sniff {
1616

17+
/**
18+
* @inheritDoc
19+
*/
20+
public function register() {
21+
return Tokens::$commentTokens;
22+
}
23+
1724
/**
1825
* @inheritDoc
1926
*/
@@ -88,11 +95,4 @@ public function process(File $phpcsFile, $stackPtr) {
8895
}
8996
}
9097

91-
/**
92-
* @inheritDoc
93-
*/
94-
public function register() {
95-
return Tokens::$commentTokens;
96-
}
97-
9898
}

PSR2R/Sniffs/Commenting/DocBlockParamAllowDefaultValueSniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ class DocBlockParamAllowDefaultValueSniff extends AbstractSniff {
1919
use CommentingTrait;
2020
use SignatureTrait;
2121

22+
/**
23+
* @inheritDoc
24+
*/
25+
public function register() {
26+
return [
27+
T_FUNCTION,
28+
];
29+
}
30+
2231
/**
2332
* @inheritDoc
2433
*/
@@ -111,13 +120,4 @@ public function process(File $phpCsFile, $stackPointer) {
111120
}
112121
}
113122

114-
/**
115-
* @inheritDoc
116-
*/
117-
public function register() {
118-
return [
119-
T_FUNCTION,
120-
];
121-
}
122-
123123
}

PSR2R/Sniffs/Commenting/DocBlockParamArraySniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ class DocBlockParamArraySniff extends AbstractSniff {
1717

1818
use CommentingTrait;
1919

20+
/**
21+
* @inheritDoc
22+
*/
23+
public function register() {
24+
return [
25+
T_FUNCTION,
26+
];
27+
}
28+
2029
/**
2130
* @inheritDoc
2231
*/
@@ -86,13 +95,4 @@ public function process(File $phpCsFile, $stackPointer) {
8695
}
8796
}
8897

89-
/**
90-
* @inheritDoc
91-
*/
92-
public function register() {
93-
return [
94-
T_FUNCTION,
95-
];
96-
}
97-
9898
}

PSR2R/Sniffs/Commenting/DocBlockParamNoOpSniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
*/
1414
class DocBlockParamNoOpSniff extends AbstractSniff {
1515

16+
/**
17+
* @inheritDoc
18+
*/
19+
public function register() {
20+
return [
21+
T_FUNCTION,
22+
];
23+
}
24+
1625
/**
1726
* @inheritDoc
1827
*/
@@ -61,13 +70,4 @@ public function process(File $phpCsFile, $stackPointer) {
6170
}
6271
}
6372

64-
/**
65-
* @inheritDoc
66-
*/
67-
public function register() {
68-
return [
69-
T_FUNCTION,
70-
];
71-
}
72-
7373
}

PSR2R/Sniffs/Commenting/DocBlockParamNotJustNullSniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ class DocBlockParamNotJustNullSniff extends AbstractSniff {
1818
use CommentingTrait;
1919
use SignatureTrait;
2020

21+
/**
22+
* @inheritDoc
23+
*/
24+
public function register() {
25+
return [
26+
T_FUNCTION,
27+
];
28+
}
29+
2130
/**
2231
* @inheritDoc
2332
*/
@@ -72,13 +81,4 @@ public function process(File $phpCsFile, $stackPointer) {
7281
}
7382
}
7483

75-
/**
76-
* @inheritDoc
77-
*/
78-
public function register() {
79-
return [
80-
T_FUNCTION,
81-
];
82-
}
83-
8484
}

PSR2R/Sniffs/Commenting/DocBlockParamSniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ class DocBlockParamSniff extends AbstractSniff {
1818
use CommentingTrait;
1919
use SignatureTrait;
2020

21+
/**
22+
* @inheritDoc
23+
*/
24+
public function register() {
25+
return [
26+
T_FUNCTION,
27+
];
28+
}
29+
2130
/**
2231
* @inheritDoc
2332
*/
@@ -115,15 +124,6 @@ public function process(File $phpCsFile, $stackPointer) {
115124
}
116125
}
117126

118-
/**
119-
* @inheritDoc
120-
*/
121-
public function register() {
122-
return [
123-
T_FUNCTION,
124-
];
125-
}
126-
127127
/**
128128
* //TODO: Replace with SignatureTrait
129129
*

PSR2R/Sniffs/Commenting/DocBlockPipeSpacingSniff.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
*/
1414
class DocBlockPipeSpacingSniff extends AbstractSniff {
1515

16+
/**
17+
* @inheritDoc
18+
*/
19+
public function register() {
20+
return [
21+
T_DOC_COMMENT_STRING,
22+
];
23+
}
24+
1625
/**
1726
* @inheritDoc
1827
*/
@@ -57,13 +66,4 @@ public function process(File $phpcsFile, $stackPtr) {
5766
}
5867
}
5968

60-
/**
61-
* @inheritDoc
62-
*/
63-
public function register() {
64-
return [
65-
T_DOC_COMMENT_STRING,
66-
];
67-
}
68-
6969
}

PSR2R/Sniffs/Commenting/DocBlockReturnSelfSniff.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
*/
1414
class DocBlockReturnSelfSniff extends AbstractSniff {
1515

16+
/**
17+
* @inheritDoc
18+
*/
19+
public function register() {
20+
return [
21+
T_CLASS,
22+
T_INTERFACE,
23+
T_TRAIT,
24+
T_FUNCTION,
25+
T_VARIABLE,
26+
];
27+
}
28+
1629
/**
1730
* @inheritDoc
1831
*/
@@ -62,19 +75,6 @@ public function process(File $phpCsFile, $stackPointer) {
6275
}
6376
}
6477

65-
/**
66-
* @inheritDoc
67-
*/
68-
public function register() {
69-
return [
70-
T_CLASS,
71-
T_INTERFACE,
72-
T_TRAIT,
73-
T_FUNCTION,
74-
T_VARIABLE,
75-
];
76-
}
77-
7878
/** @noinspection MoreThanThreeArgumentsInspection */
7979

8080
/**

PSR2R/Sniffs/Commenting/DocBlockReturnVoidSniff.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class DocBlockReturnVoidSniff extends AbstractSniff {
1818

1919
use CommentingTrait;
2020

21+
/**
22+
* @inheritDoc
23+
*/
24+
public function register() {
25+
return [T_FUNCTION];
26+
}
27+
2128
/**
2229
* @inheritDoc
2330
*/
@@ -78,13 +85,6 @@ public function process(File $phpcsFile, $stackPtr) {
7885
$this->addReturnAnnotation($phpcsFile, $docBlockEndIndex, $returnType);
7986
}
8087

81-
/**
82-
* @inheritDoc
83-
*/
84-
public function register() {
85-
return [T_FUNCTION];
86-
}
87-
8888
/**
8989
* @param \PHP_CodeSniffer\Files\File $phpcsFile
9090
* @param int $index

PSR2R/Sniffs/Commenting/DocBlockShortTypeSniff.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
*/
1414
class DocBlockShortTypeSniff extends AbstractSniff {
1515

16+
/**
17+
* @inheritDoc
18+
*/
19+
public function register() {
20+
return [
21+
T_CLASS,
22+
T_INTERFACE,
23+
T_TRAIT,
24+
T_FUNCTION,
25+
T_VARIABLE,
26+
];
27+
}
28+
1629
/**
1730
* @inheritDoc
1831
*/
@@ -59,19 +72,6 @@ public function process(File $phpCsFile, $stackPointer) {
5972
}
6073
}
6174

62-
/**
63-
* @inheritDoc
64-
*/
65-
public function register() {
66-
return [
67-
T_CLASS,
68-
T_INTERFACE,
69-
T_TRAIT,
70-
T_FUNCTION,
71-
T_VARIABLE,
72-
];
73-
}
74-
7575
/** @noinspection MoreThanThreeArgumentsInspection */
7676

7777
/**

0 commit comments

Comments
 (0)