Skip to content

Commit 18d03c4

Browse files
committed
PHP 8.1: Squiz/FileComment - Added support for enums
1 parent 25318a9 commit 18d03c4

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
16531653
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.6.inc" role="test" />
16541654
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.7.inc" role="test" />
16551655
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.8.inc" role="test" />
1656+
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.9.inc" role="test" />
16561657
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.1.js" role="test" />
16571658
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.1.js.fixed" role="test" />
16581659
<file baseinstalldir="PHP/CodeSniffer" name="FileCommentUnitTest.2.js" role="test" />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public function process(File $phpcsFile, $stackPtr)
9595
T_CLASS,
9696
T_INTERFACE,
9797
T_TRAIT,
98+
T_ENUM,
9899
T_FUNCTION,
99100
T_CLOSURE,
100101
T_PUBLIC,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* This should not be recognized as a file comment, but as a enum comment.
4+
*
5+
* @package Package
6+
* @subpackage Subpackage
7+
* @author Squiz Pty Ltd <[email protected]>
8+
* @copyright 2010-2014 Squiz Pty Ltd (ABN 77 084 670 600)
9+
*/
10+
11+
enum Foo {
12+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function getErrorList($testFile='FileCommentUnitTest.inc')
4545
case 'FileCommentUnitTest.4.inc':
4646
case 'FileCommentUnitTest.6.inc':
4747
case 'FileCommentUnitTest.7.inc':
48+
case 'FileCommentUnitTest.9.inc':
4849
return [1 => 1];
4950

5051
case 'FileCommentUnitTest.5.inc':

0 commit comments

Comments
 (0)