Skip to content

Commit

Permalink
YoastCS rules: enforce fully qualified global functions and constants
Browse files Browse the repository at this point in the history
Related to 303

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | 1
| Yst News          | 2
| Yst Local         | --
| Yst Video         | --
| Yst Premium       | 18
| Yst Free          | 46

Note: this rule was previously already "silently" enforced via clean-up sweeps.
  • Loading branch information
jrfnl committed Dec 14, 2023
1 parent 9279202 commit 2de2688
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Yoast/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@
<rule ref="Universal.UseStatements.DisallowUseConst"/>
<rule ref="Universal.UseStatements.DisallowUseFunction"/>

<!-- CS: For global functions/constants: use fully qualified inline names. -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>


<!--
#############################################################################
Expand Down

0 comments on commit 2de2688

Please sign in to comment.