Skip to content

Commit

Permalink
updated - wpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveJonesDev committed Jun 5, 2024
1 parent a257b7a commit aa2a1e5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inc/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function __construct() {
* Registers activation and deactivation hooks, and adds action to load text domain.
*/
public function init() {
register_activation_hook( EDECU_PLUGIN_FILE, array( $this, 'activate' ) );
register_deactivation_hook( EDECU_PLUGIN_FILE, array( $this, 'deactivate' ) );
register_activation_hook( EDECU_PLUGIN_FILE, [ $this, 'activate' ] );
register_deactivation_hook( EDECU_PLUGIN_FILE, [ $this, 'deactivate' ] );
}

/**
Expand Down
29 changes: 26 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Enable Contributor Uploads">
<description>Enable Contributor Uploads Wordpress Coding Standards</description>
<ruleset name="WordPress Coding Standards for Accessibility Checker">
<description>Accessibility Checker Wordpress Coding Standards</description>

<!-- Scan all files in directory -->
<file>.</file>
Expand Down Expand Up @@ -47,7 +47,7 @@
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="enable-contributor-uploads"/>
<element value="accessibility-checker"/>
</property>
</properties>
</rule>
Expand Down Expand Up @@ -129,4 +129,27 @@
-->
<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />

<!-- Exclude these rules from the tests directory only -->
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>

<!-- Allow and enforce shorthand arrays -->
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

<!-- Ignore class names -->
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>*/plugin.php</exclude-pattern>
</rule>

</ruleset>

0 comments on commit aa2a1e5

Please sign in to comment.