From 0802b2b9e8f03f0ced8825d3a8734a66801dc882 Mon Sep 17 00:00:00 2001 From: Genyus Date: Tue, 25 Apr 2023 16:24:39 +0100 Subject: [PATCH] style: applies PHPCS rules --- .../cbf-academy/includes/Admin/Main.php | 1 + .../plugins/cbf-academy/includes/Assets.php | 1 + .../includes/Customizations/BuddyBoss.php | 4 +- .../plugins/cbf-academy/includes/Install.php | 1 - web/app/plugins/cbf-academy/includes/Main.php | 4 +- .../cbf-academy/vendor/composer/installed.php | 12 +- web/app/themes/cbf-academy/functions.php | 63 ++++--- web/app/themes/cbf-jobs/footer.php | 162 +++++++++--------- web/app/themes/cbf-jobs/functions.php | 62 ++++--- 9 files changed, 152 insertions(+), 158 deletions(-) diff --git a/web/app/plugins/cbf-academy/includes/Admin/Main.php b/web/app/plugins/cbf-academy/includes/Admin/Main.php index 263feaef..ac9eaa81 100644 --- a/web/app/plugins/cbf-academy/includes/Admin/Main.php +++ b/web/app/plugins/cbf-academy/includes/Admin/Main.php @@ -36,6 +36,7 @@ public static function hooks() { * * @return void */ + // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded public static function conditional_includes() { $screen = get_current_screen(); diff --git a/web/app/plugins/cbf-academy/includes/Assets.php b/web/app/plugins/cbf-academy/includes/Assets.php index 46ee115a..c8c0f454 100644 --- a/web/app/plugins/cbf-academy/includes/Assets.php +++ b/web/app/plugins/cbf-academy/includes/Assets.php @@ -200,6 +200,7 @@ private static function enqueue_style( $handle, $path = '', $deps = array(), $ve * * @return void */ + // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded public static function load_scripts() { if ( ! did_action( 'before__init' ) ) { diff --git a/web/app/plugins/cbf-academy/includes/Customizations/BuddyBoss.php b/web/app/plugins/cbf-academy/includes/Customizations/BuddyBoss.php index 5375eb7d..82cd7f75 100644 --- a/web/app/plugins/cbf-academy/includes/Customizations/BuddyBoss.php +++ b/web/app/plugins/cbf-academy/includes/Customizations/BuddyBoss.php @@ -33,8 +33,8 @@ public static function hooks() { * @return string */ public static function bp_core_get_table_prefix( $base_prefix ) { - if(is_multisite()){ - $base_prefix .= get_current_blog_id() . "_"; + if ( is_multisite() ) { + $base_prefix .= get_current_blog_id() . '_'; } return $base_prefix; diff --git a/web/app/plugins/cbf-academy/includes/Install.php b/web/app/plugins/cbf-academy/includes/Install.php index e64957e6..71868f94 100644 --- a/web/app/plugins/cbf-academy/includes/Install.php +++ b/web/app/plugins/cbf-academy/includes/Install.php @@ -24,7 +24,6 @@ final class Install { public static function install() { // Perform install actions here. - // Trigger action. do_action( '_installed' ); } diff --git a/web/app/plugins/cbf-academy/includes/Main.php b/web/app/plugins/cbf-academy/includes/Main.php index 58433ecb..0efe8e44 100644 --- a/web/app/plugins/cbf-academy/includes/Main.php +++ b/web/app/plugins/cbf-academy/includes/Main.php @@ -104,7 +104,6 @@ public static function init() { do_action( 'before__init' ); // Add needed hooks here. - // After init action. do_action( '_init' ); } @@ -115,6 +114,7 @@ public static function init() { * * @return boolean */ + // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded private static function check_plugin_requirements() { $errors = array(); @@ -179,6 +179,6 @@ private static function load_plugin_textdomain() { load_textdomain( 'cbf-academy', WP_LANG_DIR . '/cbf-academy/cbf-academy-' . $locale . '.mo' ); - load_plugin_textdomain( 'cbf-academy', false, plugin_basename( dirname( __FILE__ ) ) . '/i18n/languages' ); + load_plugin_textdomain( 'cbf-academy', false, plugin_basename( __DIR__ ) . '/i18n/languages' ); } } diff --git a/web/app/plugins/cbf-academy/vendor/composer/installed.php b/web/app/plugins/cbf-academy/vendor/composer/installed.php index 387cedb0..571d171c 100644 --- a/web/app/plugins/cbf-academy/vendor/composer/installed.php +++ b/web/app/plugins/cbf-academy/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'author-slug/cbf-academy', - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => '813f9304e02c3c2b68c195148a1114da17cc76c1', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'author-slug/cbf-academy' => array( - 'pretty_version' => '1.0.0+no-version-set', - 'version' => '1.0.0.0', - 'reference' => NULL, + 'pretty_version' => 'dev-main', + 'version' => 'dev-main', + 'reference' => '813f9304e02c3c2b68c195148a1114da17cc76c1', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/web/app/themes/cbf-academy/functions.php b/web/app/themes/cbf-academy/functions.php index fccf6e57..90cee298 100644 --- a/web/app/themes/cbf-academy/functions.php +++ b/web/app/themes/cbf-academy/functions.php @@ -13,20 +13,18 @@ * * @since CBF Academy 1.0.0 */ -function cbf_academy_theme_languages() -{ - /** - * Makes child theme available for translation. - * Translations can be added into the /languages/ directory. - */ +function cbf_academy_theme_languages() { + /** + * Makes child theme available for translation. + * Translations can be added into the /languages/ directory. + */ - // Translate text from the PARENT theme. - load_theme_textdomain( 'buddyboss-theme', get_stylesheet_directory() . '/languages' ); - - // Translate text from the CHILD theme only. - // Change 'buddyboss-theme' instances in all child theme files to 'buddyboss-theme-child'. - // load_theme_textdomain( 'buddyboss-theme-child', get_stylesheet_directory() . '/languages' ); + // Translate text from the PARENT theme. + load_theme_textdomain( 'buddyboss-theme', get_stylesheet_directory() . '/languages' ); + // Translate text from the CHILD theme only. + // Change 'buddyboss-theme' instances in all child theme files to 'buddyboss-theme-child'. + // load_theme_textdomain( 'buddyboss-theme-child', get_stylesheet_directory() . '/languages' ); } add_action( 'after_setup_theme', 'cbf_academy_theme_languages' ); @@ -35,23 +33,22 @@ function cbf_academy_theme_languages() * * @since CBF Academy Theme 1.0.0 */ -function cbf_academy_theme_scripts_styles() -{ - /** - * Scripts and Styles loaded by the parent theme can be unloaded if needed - * using wp_deregister_script or wp_deregister_style. - * - * See the WordPress Codex for more information about those functions: - * http://codex.wordpress.org/Function_Reference/wp_deregister_script - * http://codex.wordpress.org/Function_Reference/wp_deregister_style - **/ - $version = wp_get_theme( 'cbf-academy' )->get( 'Version' ); +function cbf_academy_theme_scripts_styles() { + /** + * Scripts and Styles loaded by the parent theme can be unloaded if needed + * using wp_deregister_script or wp_deregister_style. + * + * See the WordPress Codex for more information about those functions: + * http://codex.wordpress.org/Function_Reference/wp_deregister_script + * http://codex.wordpress.org/Function_Reference/wp_deregister_style + **/ + $version = wp_get_theme( 'cbf-academy' )->get( 'Version' ); - // Styles - wp_enqueue_style( 'cbf-academy-css', get_stylesheet_directory_uri().'/assets/css/custom.css', false, $version ); + // Styles + wp_enqueue_style( 'cbf-academy-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', false, $version ); - // Javascript - wp_enqueue_script( 'cbf-academy-js', get_stylesheet_directory_uri().'/assets/js/custom.js', false, $version ); + // Javascript + wp_enqueue_script( 'cbf-academy-js', get_stylesheet_directory_uri() . '/assets/js/custom.js', false, $version ); } add_action( 'wp_enqueue_scripts', 'cbf_academy_theme_scripts_styles', 9999 ); @@ -67,13 +64,13 @@ function cbf_academy_theme_scripts_styles() * @return string */ function cbf_academy_bp_core_get_table_prefix( $base_prefix ) { - if(is_multisite()){ - $blog_id = get_current_blog_id(); - $base_prefix .= "{$blog_id}_"; - } + if ( is_multisite() ) { + $blog_id = get_current_blog_id(); + $base_prefix .= "{$blog_id}_"; + } - return $base_prefix; + return $base_prefix; } add_filter( 'bp_core_get_table_prefix', 'cbf_academy_bp_core_get_table_prefix' ); -?> \ No newline at end of file + diff --git a/web/app/themes/cbf-jobs/footer.php b/web/app/themes/cbf-jobs/footer.php index 79f110ac..3876ac63 100644 --- a/web/app/themes/cbf-jobs/footer.php +++ b/web/app/themes/cbf-jobs/footer.php @@ -12,96 +12,96 @@ $hide_footer = false; $page_id = get_the_ID(); -if ( is_page() ){ - $hide_footer = get_post_meta( $page_id, '_hide_footer', true ); +if ( is_page() ) { + $hide_footer = get_post_meta( $page_id, '_hide_footer', true ); } if ( onepress_is_wc_active() ) { - if ( is_shop() ) { - $page_id = wc_get_page_id('shop'); - $hide_footer = get_post_meta( $page_id, '_hide_footer', true ); - } + if ( is_shop() ) { + $page_id = wc_get_page_id( 'shop' ); + $hide_footer = get_post_meta( $page_id, '_hide_footer', true ); + } } if ( ! $hide_footer ) { - ?> - - + get( 'Version' ); +function cbf_jobs_theme_scripts_styles() { + /** + * Scripts and Styles loaded by the parent theme can be unloaded if needed + * using wp_deregister_script or wp_deregister_style. + * + * See the WordPress Codex for more information about those functions: + * http://codex.wordpress.org/Function_Reference/wp_deregister_script + * http://codex.wordpress.org/Function_Reference/wp_deregister_style + **/ + $version = wp_get_theme( 'cbf-jobs' )->get( 'Version' ); - // Styles - wp_deregister_style( 'onepress-fa' ); - wp_deregister_style( 'onepress-bootstrap' ); - wp_enqueue_style( 'onepress-fa', 'https://codingblackfemales.com/vendor/fontawesome-free/css/all.min.css', false, $version ); - wp_enqueue_style( 'onepress-bootstrap', 'https://codingblackfemales.com/vendor/bootstrap/css/bootstrap.min.css', false, $version ); - wp_enqueue_style( 'cbf-jobs-css', get_stylesheet_directory_uri().'/assets/css/custom.css', false, $version ); - wp_enqueue_style( 'cbf-style', 'https://codingblackfemales.com/css/agency.css', false, $version ); + // Styles + wp_deregister_style( 'onepress-fa' ); + wp_deregister_style( 'onepress-bootstrap' ); + wp_enqueue_style( 'onepress-fa', 'https://codingblackfemales.com/vendor/fontawesome-free/css/all.min.css', false, $version ); + wp_enqueue_style( 'onepress-bootstrap', 'https://codingblackfemales.com/vendor/bootstrap/css/bootstrap.min.css', false, $version ); + wp_enqueue_style( 'cbf-jobs-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', false, $version ); + wp_enqueue_style( 'cbf-style', 'https://codingblackfemales.com/css/agency.css', false, $version ); - // Javascript - wp_enqueue_script( 'cbf-jobs-js', get_stylesheet_directory_uri().'/assets/js/custom.js', false, $version ); + // Javascript + wp_enqueue_script( 'cbf-jobs-js', get_stylesheet_directory_uri() . '/assets/js/custom.js', false, $version ); } add_action( 'wp_enqueue_scripts', 'cbf_jobs_theme_scripts_styles', 9999 ); @@ -65,4 +62,3 @@ function cbf_jobs_theme_scripts_styles() // Add your own custom functions here -?>