Skip to content

Commit 69a028b

Browse files
committed
Update new "About Standards" page
Make it explicit that a category should not be called "Sniffs".
1 parent b222819 commit 69a028b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

wiki/About-Standards-for-PHP_CodeSniffer.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,14 @@ All sniffs MUST have a name, so a sniff class called just and only `Sniff` is no
139139

140140
Both the sniff name and the category name MUST be valid symbol names in PHP.
141141

142+
The name "Sniffs" MUST NOT be used as a category name.
143+
142144

143145
#### 3. Namespace and class name
144146

145147
The namespace and class name MUST follow [PSR-4](https://www.php-fig.org/psr/psr-4/).
146148

147-
This means that - taking the example directory structure above in to account - the namespace name MUST end with `[StandardName]\Sniffs\[CategoryName]` and the class name MUST be exactly the same as the file name (minus the `.php` file extension).
149+
This means that - taking the example directory structure above into account - the namespace name MUST end with `[StandardName]\Sniffs\[CategoryName]` and the class name MUST be exactly the same as the file name (minus the `.php` file extension).
148150

149151
> [!NOTE]
150152
> As long as an external standard is registered with PHP_CodeSniffer via `installed_paths` and the standard follows the directory layout and naming conventions, PHP_CodeSniffer can, and will, automatically handle the sniff autoloading.

0 commit comments

Comments
 (0)