Skip to content

Commit ad369a1

Browse files
committed
PHP 8.1: PEAR/FileComment - Added support for enums
1 parent 209d417 commit ad369a1

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
10121012
<file baseinstalldir="PHP/CodeSniffer" name="ClassCommentUnitTest.php" role="test" />
10131013
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.1.inc" role="test" />
10141014
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.2.inc" role="test" />
1015+
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.3.inc" role="test" />
10151016
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.php" role="test" />
10161017
<file baseinstalldir="PHP/CodeSniffer" name="FunctionCommentUnitTest.inc" role="test" />
10171018
<file baseinstalldir="PHP/CodeSniffer" name="FunctionCommentUnitTest.inc.fixed" role="test" />

src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function process(File $phpcsFile, $stackPtr)
161161
T_CLASS,
162162
T_INTERFACE,
163163
T_TRAIT,
164+
T_ENUM,
164165
T_FUNCTION,
165166
T_CLOSURE,
166167
T_PUBLIC,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
/**
4+
* Some comment
5+
*/
6+
enum SomeEnum
7+
{
8+
}

src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public function getErrorList($testFile='FileCommentUnitTest.inc')
5050
case 'FileCommentUnitTest.2.inc':
5151
return [1 => 1];
5252

53+
case 'FileCommentUnitTest.3.inc':
54+
return [1 => 1];
55+
5356
default:
5457
return [];
5558
}//end switch

0 commit comments

Comments
 (0)