mirror of
https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2025-08-30 03:11:24 +08:00
OneObjectStructurePerFile: move from Extra
to Core
Per the discussion had on Slack about this initiated by GaryJones. WP Core currently has 27 violations against this rule. In `Extra` the error message was changed and downgraded to a `warning`. Now the sniff will be added to `Core`, per this PR, the: * Message text will still be changed a little to be clearer, but will be stricter. * The message will be an `error` and not be downgraded to a `warning`. To do: - [ ] Add a rule to this effect to the handbook.
This commit is contained in:
parent
0bb2688c53
commit
88c56085b9
2 changed files with 6 additions and 6 deletions
|
@ -517,6 +517,12 @@
|
|||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Encourage having only one class/interface/trait per file.
|
||||
Moved from Extra to Core after discussion on Slack. -->
|
||||
<rule ref="Generic.Files.OneObjectStructurePerFile">
|
||||
<message>Best practices: Declare only one class/interface/trait in a file.</message>
|
||||
</rule>
|
||||
|
||||
<!--
|
||||
#############################################################################
|
||||
Not in the coding standard handbook: WP specific sniffs.
|
||||
|
|
|
@ -56,12 +56,6 @@
|
|||
<!-- https://github.com/WordPress/WordPress-Coding-Standards/pull/382#discussion_r29981655 -->
|
||||
<!--<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>-->
|
||||
|
||||
<!-- Encourage having only one class/interface/trait per file. -->
|
||||
<rule ref="Generic.Files.OneObjectStructurePerFile">
|
||||
<type>warning</type>
|
||||
<message>Best practice suggestion: Declare only one class/interface/trait in a file.</message>
|
||||
</rule>
|
||||
|
||||
<!-- Verify modifier keywords for declared methods and properties in classes.
|
||||
https://github.com/WordPress/WordPress-Coding-Standards/issues/1101 -->
|
||||
<rule ref="Squiz.Scope.MethodScope"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue