Skip to content

Commit 5946d53

Browse files
authored
Merge pull request #951 from PHPCSStandards/feature/squiz-doccommentalignment-final-classes-and-properties
Squiz/DocCommentAlignment: add support for final classes and final properties
2 parents a3e883d + bb88904 commit 5946d53

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function process(File $phpcsFile, $stackPtr)
7272
T_PROTECTED => true,
7373
T_STATIC => true,
7474
T_ABSTRACT => true,
75+
T_FINAL => true,
7576
T_PROPERTY => true,
7677
T_OBJECT => true,
7778
T_PROTOTYPE => true,

src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,16 @@ enum Suits: string
101101
* Example with no errors.
102102
**************************************************************************/
103103
function example() {}
104+
105+
/**
106+
* Some info about the class here.
107+
*/
108+
final class FinalClassWithFinalProp
109+
{
110+
/**
111+
*Some info about the property here.
112+
*
113+
* @var int
114+
*/
115+
final $property = 10;
116+
}

src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,16 @@ enum Suits: string
101101
* Example with no errors.
102102
**************************************************************************/
103103
function example() {}
104+
105+
/**
106+
* Some info about the class here.
107+
*/
108+
final class FinalClassWithFinalProp
109+
{
110+
/**
111+
* Some info about the property here.
112+
*
113+
* @var int
114+
*/
115+
final $property = 10;
116+
}

src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public function getErrorList($testFile='')
5656
$errors[91] = 1;
5757
$errors[95] = 1;
5858
$errors[96] = 1;
59+
60+
$errors[106] = 1;
61+
$errors[107] = 1;
62+
$errors[111] = 2;
63+
$errors[112] = 1;
64+
$errors[113] = 1;
65+
$errors[114] = 1;
5966
}
6067

6168
return $errors;

0 commit comments

Comments
 (0)