From 92b9e9197abe1094633d025e29591e01b73b4d8a Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Sun, 17 Jul 2022 16:02:53 -0700 Subject: [PATCH] PHPCS --- inc/class-plugin.php | 8 +++++--- phpcs.xml | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/class-plugin.php b/inc/class-plugin.php index 84c65fc..573c7d6 100644 --- a/inc/class-plugin.php +++ b/inc/class-plugin.php @@ -47,7 +47,7 @@ class Plugin { public static function get_instance(): Plugin { if ( ! is_a( self::$_instance, __CLASS__ ) ) { self::$_instance = new self(); - self::$_instance->setup(); + self::$_instance->_setup(); } return self::$_instance; @@ -56,14 +56,16 @@ class Plugin { /** * Silence is golden! */ - private function __construct() {} + private function __construct() { + // Add nothing here. + } /** * Register hooks. * * @return void */ - private function setup(): void { + private function _setup(): void { add_action( 'init', [ $this, 'action_init' ] ); add_filter( 'oembed_fetch_url', diff --git a/phpcs.xml b/phpcs.xml index fc325fa..ff47dc7 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -26,7 +26,9 @@ <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> <!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties --> <config name="minimum_supported_wp_version" value="4.7"/> - <rule ref="WordPress" /> + <rule ref="WordPress"> + <exclude name="Generic.Arrays.DisallowShortArraySyntax" /> + </rule> <rule ref="WordPressVIPMinimum" /> <rule ref="WordPress-VIP-Go" /> <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> -- GitLab