Skip to content

Commit cc0cc7b

Browse files
committed
🎨 Update coding standard
1 parent 88ef163 commit cc0cc7b

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

.phpcs.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Advanced Set">
3+
<rule ref="EpiphytCodingStandard">
4+
<exclude name="SlevomatCodingStandard.Namespaces.NamespaceSpacing.IncorrectLinesCountBeforeNamespace"/>
5+
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/>
6+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
7+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint"/>
8+
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/>
9+
</rule>
10+
11+
<config name="testVersion" value="5.6-"/>
12+
<config name="minimum_supported_wp_version" value="6.2"/>
13+
14+
<exclude-pattern>inc/lib</exclude-pattern>
15+
16+
<rule ref="WordPress.WP.I18n">
17+
<properties>
18+
<property name="text_domain" type="array" value="block-control"/>
19+
</properties>
20+
</rule>
21+
22+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
23+
<properties>
24+
<property name="prefixes" type="array">
25+
<element value="block_control"/>
26+
</property>
27+
</properties>
28+
</rule>
29+
</ruleset>

CONTRIBUTING.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,7 @@ If you want to contribute code, please create an issue first so that we can disc
1818

1919
### Code style
2020

21-
Basically we use the default WordPress coding style with some small adjustments. We recommend using the [WordPress Coding Standard for PHP Code Sniffer](https://github.com/WordPress/WordPress-Coding-Standards) and exclude the following rules:
22-
23-
```xml
24-
<rule ref="WordPress">
25-
<exclude name="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
26-
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_key"/>
27-
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_value"/>
28-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound"/>
29-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound"/>
30-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound"/>
31-
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
32-
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
33-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound"/>
34-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed"/>
35-
<exclude name="WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed"/>
36-
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found"/>
37-
<exclude name="WordPress.WP.EnqueuedResourceParameters.NotInFooter"/>
38-
</rule>
39-
```
21+
We’re using the [EpiphytCodingStandard](https://github.com/epiphyt/EpiphytCodingStandard), which is a more strict adaptation of the WordPress Coding Standard for PHP Code. This coding standard is mandatory for every code change.
4022

4123
### Testing
4224

0 commit comments

Comments
 (0)