From 3927a38191b34140384676b35b6171dcfe94341e Mon Sep 17 00:00:00 2001 From: Chirag Mathur Date: Thu, 18 Jul 2024 14:09:08 +0530 Subject: [PATCH 1/3] Fix: Fixed phpcs issues Fixed PHPCS issues in the code files Excluded the sniff for shorthand array syntax --- inc/classes/class-assets.php | 2 -- inc/traits/trait-singleton.php | 4 +--- phpcs.xml.dist | 5 +++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/classes/class-assets.php b/inc/classes/class-assets.php index 772eae39..18bca005 100644 --- a/inc/classes/class-assets.php +++ b/inc/classes/class-assets.php @@ -24,7 +24,6 @@ class Assets { protected function __construct() { // Setup hooks. $this->setup_hooks(); - } /** @@ -170,5 +169,4 @@ public function get_file_version( $file, $ver = false ) { public function enqueue_assets() { wp_enqueue_style( 'elementary-theme-styles' ); } - } diff --git a/inc/traits/trait-singleton.php b/inc/traits/trait-singleton.php index f845e731..579bb129 100644 --- a/inc/traits/trait-singleton.php +++ b/inc/traits/trait-singleton.php @@ -59,7 +59,7 @@ final public static function get_instance() { * * @var array */ - static $instance = []; + static $instance = array(); /** * If this trait is implemented in a class which has multiple @@ -83,7 +83,5 @@ final public static function get_instance() { } return $instance[ $called_class ]; - } - } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 0ab2a910..a818e8b5 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -136,4 +136,9 @@ tests/phpstan/* tests/phpunit/includes/MarkupComparison.php + + + + + From 5b314e8e35630e141f0b025e4931f090bd4c8d66 Mon Sep 17 00:00:00 2001 From: Chirag Mathur Date: Thu, 18 Jul 2024 14:21:19 +0530 Subject: [PATCH 2/3] Fix: Undo auto-formatting changes --- inc/traits/trait-singleton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/traits/trait-singleton.php b/inc/traits/trait-singleton.php index 579bb129..5b86c492 100644 --- a/inc/traits/trait-singleton.php +++ b/inc/traits/trait-singleton.php @@ -59,7 +59,7 @@ final public static function get_instance() { * * @var array */ - static $instance = array(); + static $instance = []; /** * If this trait is implemented in a class which has multiple From fead75c8d601a96ab41446c9a4cd3358ac326ad0 Mon Sep 17 00:00:00 2001 From: Chirag Mathur Date: Thu, 18 Jul 2024 14:43:17 +0530 Subject: [PATCH 3/3] Fix: Made requested changes in feedback --- phpcs.xml.dist | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index a818e8b5..b55b2b99 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -37,7 +37,10 @@ ############################################################################# --> - + + + + - - - -