File tree Expand file tree Collapse file tree 7 files changed +103
-0
lines changed Expand file tree Collapse file tree 7 files changed +103
-0
lines changed Original file line number Diff line number Diff line change
1
+ check : test lint
2
+
3
+ test :
4
+ bin/phpunit
5
+
6
+ lint : codestyle static-analysis
7
+
8
+ fix :
9
+ bin/phpcbf
10
+
11
+ codestyle :
12
+ bin/phpcs
13
+
14
+ static-analysis :
15
+ bin/phpstan
Original file line number Diff line number Diff line change 33
33
</properties >
34
34
</rule >
35
35
36
+ <!-- SlevomatCodingStandard.Commenting -->
37
+ <rule ref =" SlevomatCodingStandard.Commenting.UselessInheritDocComment" />
38
+
36
39
<!-- SlevomatCodingStandard.Functions -->
37
40
<rule ref =" SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
38
41
<rule ref =" SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ function doesAThing(array $data): int {
131
131
#### PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose
132
132
#### SlevomatCodingStandard.Classes.ClassStructure
133
133
#### SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
134
+ #### SlevomatCodingStandard.Commenting.UselessInheritDocComment
134
135
#### SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
135
136
#### SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
136
137
#### SlevomatCodingStandard.Functions.StaticClosure
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace PreviousNext \CodingStandard \Tests \Sniffs ;
6
+
7
+ use SlevomatCodingStandard \Sniffs \Commenting \UselessInheritDocCommentSniff ;
8
+
9
+ /**
10
+ * @covers \SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff
11
+ */
12
+ final class UselessInheritDocCommentTest extends Base {
13
+
14
+ public function testNoError (): void {
15
+ $ report = self ::checkFile (__DIR__ . '/fixtures/UselessInheritDocCommentNoError.php ' );
16
+ self ::assertNoSniffErrorInFile ($ report );
17
+ }
18
+
19
+ public function testMissing (): void {
20
+ $ report = self ::checkFile (__DIR__ . '/fixtures/UselessInheritDocCommentError.php ' );
21
+ self ::assertSame (1 , $ report ->getErrorCount ());
22
+ self ::assertSniffError ($ report , 14 , UselessInheritDocCommentSniff::CODE_USELESS_INHERIT_DOC_COMMENT );
23
+ }
24
+
25
+ protected static function getSniffName (): string {
26
+ return 'SlevomatCodingStandard.Commenting.UselessInheritDocComment ' ;
27
+ }
28
+
29
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Sniffs \fixtures ;
6
+
7
+ use PreviousNext \CodingStandard \Tests \Sniffs \fixtures \UselessInheritDocCommentParent ;
8
+
9
+ /**
10
+ * The class.
11
+ */
12
+ final class UselessInheritDocCommentError extends UselessInheritDocCommentParent {
13
+
14
+ /**
15
+ * {@inheritdoc}
16
+ */
17
+ public function foo (): void {
18
+ parent ::foo ();
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace PreviousNext \CodingStandard \Tests \Sniffs \fixtures ;
6
+
7
+ /**
8
+ * The class.
9
+ */
10
+ final class UselessInheritDocCommentNoError extends UselessInheritDocCommentParent {
11
+
12
+ /**
13
+ * Foo.
14
+ */
15
+ public function foo (): void {
16
+ parent ::foo ();
17
+ }
18
+
19
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace PreviousNext \CodingStandard \Tests \Sniffs \fixtures ;
6
+
7
+ /**
8
+ * The parent class.
9
+ */
10
+ abstract class UselessInheritDocCommentParent {
11
+
12
+ public function foo (): void {
13
+ }
14
+
15
+ }
You can’t perform that action at this time.
0 commit comments