From d3283bdb02f91bbc7fa4304ee6d436f38cfd8da0 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Tue, 27 Apr 2021 09:54:07 +0100 Subject: [PATCH] chore: lint code --- src/admin/class-footnotes-admin.php | 8 ++++---- src/admin/class-footnotes-wysiwyg.php | 10 +++++++--- src/admin/layout/class-footnotes-layout-engine.php | 2 +- src/admin/layout/class-footnotes-layout-init.php | 6 ++++-- src/admin/layout/class-footnotes-layout-settings.php | 2 +- src/includes/class-footnotes.php | 6 +++--- src/public/class-footnotes-public.php | 8 ++++---- .../class-footnotes-widget-reference-container.php | 2 +- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/admin/class-footnotes-admin.php b/src/admin/class-footnotes-admin.php index b6a62a7..6b7bc5b 100644 --- a/src/admin/class-footnotes-admin.php +++ b/src/admin/class-footnotes-admin.php @@ -36,7 +36,7 @@ class Footnotes_Admin { * @var string $version The current version of this plugin. */ private $version; - + /** * The WYSIWYG editor integration object. * @@ -79,14 +79,14 @@ class Footnotes_Admin { */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-footnotes-wysiwyg.php'; - $this->wysiwyg = new Footnotes_WYSIWYG($this->plugin_name); - + $this->wysiwyg = new Footnotes_WYSIWYG( $this->plugin_name ); + /** * The class responsible for constructing the plugin dashboard page(s). */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-footnotes-layout-init.php'; - new Footnotes_Layout_Init($this->plugin_name); + new Footnotes_Layout_Init( $this->plugin_name ); } /** diff --git a/src/admin/class-footnotes-wysiwyg.php b/src/admin/class-footnotes-wysiwyg.php index 6c9d2a7..e3a3353 100644 --- a/src/admin/class-footnotes-wysiwyg.php +++ b/src/admin/class-footnotes-wysiwyg.php @@ -23,7 +23,7 @@ class Footnotes_WYSIWYG { * @var string $plugin_name The ID of this plugin. */ private $plugin_name; - + /** * Initialize the class and set its properties. * @@ -42,9 +42,11 @@ class Footnotes_WYSIWYG { * @since 1.5.0 * @param array $p_arr_buttons pre defined Buttons from WordPress. * @return array + * + * @todo Does this need to be `static`? */ public static function new_visual_editor_button( $p_arr_buttons ) { - array_push( $p_arr_buttons, $this->plugin_name ); + array_push( $p_arr_buttons, 'footnotes' ); return $p_arr_buttons; } @@ -66,9 +68,11 @@ class Footnotes_WYSIWYG { * @since 1.5.0 * @param array $p_arr_plugins Scripts to be included to the editor. * @return array + * + * @todo Does this need to be `static`? */ public static function include_scripts( $p_arr_plugins ) { - $p_arr_plugins[ $this->plugin_name ] = plugins_url( '/../admin/js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', __FILE__ ); + $p_arr_plugins['footnotes'] = plugins_url( '/../admin/js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', __FILE__ ); return $p_arr_plugins; } diff --git a/src/admin/layout/class-footnotes-layout-engine.php b/src/admin/layout/class-footnotes-layout-engine.php index df09682..3f59c9a 100644 --- a/src/admin/layout/class-footnotes-layout-engine.php +++ b/src/admin/layout/class-footnotes-layout-engine.php @@ -87,7 +87,7 @@ abstract class Footnotes_Layout_Engine { * @return array */ abstract protected function get_meta_boxes(); - + /** * Returns an array describing a sub page section. * diff --git a/src/admin/layout/class-footnotes-layout-init.php b/src/admin/layout/class-footnotes-layout-init.php index 760f5ad..a64b225 100644 --- a/src/admin/layout/class-footnotes-layout-init.php +++ b/src/admin/layout/class-footnotes-layout-init.php @@ -43,15 +43,17 @@ class Footnotes_Layout_Init { /** * Class Constructor. Initializes all WordPress hooks for the Plugin Settings. * + * @param string $plugin_name The name of the plugin. + * * @since 1.5.0 * @since 2.8.0 Added `$plugin_name` parameter. */ public function __construct( $plugin_name ) { $this->plugin_name = $plugin_name; - + $this->load_dependencies(); - $this->settings_page = new Footnotes_Layout_Settings($this->plugin_name); + $this->settings_page = new Footnotes_Layout_Settings( $this->plugin_name ); // Register hooks/actions. add_action( 'admin_menu', array( $this, 'register_options_submenu' ) ); diff --git a/src/admin/layout/class-footnotes-layout-settings.php b/src/admin/layout/class-footnotes-layout-settings.php index cc03c01..ee7b2e7 100644 --- a/src/admin/layout/class-footnotes-layout-settings.php +++ b/src/admin/layout/class-footnotes-layout-settings.php @@ -49,7 +49,7 @@ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-footnotes-la * @since 1.5.0 */ class Footnotes_Layout_Settings extends Footnotes_Layout_Engine { - + /** * Initialize the class and set its properties. * diff --git a/src/includes/class-footnotes.php b/src/includes/class-footnotes.php index d3defa2..e590b25 100644 --- a/src/includes/class-footnotes.php +++ b/src/includes/class-footnotes.php @@ -167,9 +167,9 @@ class Footnotes { $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); $this->loader->add_filter( 'plugin_action_links_footnotes/footnotes.php', $plugin_admin, 'footnotes_action_links' ); - + $this->loader->add_filter( 'mce_buttons', $plugin_admin->wysiwyg, 'new_visual_editor_button' ); - $this->loader->add_action( 'admin_print_footer_scripts', $plugin_admin->wysiwyg, 'new_plain_text_editor_button' ); + $this->loader->add_action( 'admin_print_footer_scripts', $plugin_admin->wysiwyg, 'new_plain_text_editor_button' ); $this->loader->add_filter( 'mce_external_plugins', $plugin_admin->wysiwyg, 'include_scripts' ); @@ -194,7 +194,7 @@ class Footnotes { $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); - + $this->loader->add_action( 'widgets_init', $plugin_public, 'register_widgets' ); } diff --git a/src/public/class-footnotes-public.php b/src/public/class-footnotes-public.php index bfcb2f0..0cbaed4 100644 --- a/src/public/class-footnotes-public.php +++ b/src/public/class-footnotes-public.php @@ -36,7 +36,7 @@ class Footnotes_Public { * @var string $version The current version of this plugin. */ private $version; - + /** * The reference container widget. * @@ -133,8 +133,8 @@ class Footnotes_Public { require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-footnotes-parser.php'; require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/widget/class-footnotes-widget-reference-container.php'; - $this->reference_container_widget = new Footnotes_Widget_Reference_Container($this->plugin_name); - + $this->reference_container_widget = new Footnotes_Widget_Reference_Container( $this->plugin_name ); + $this->a_obj_task = new Footnotes_Parser(); } @@ -261,7 +261,7 @@ class Footnotes_Public { } } - + /** * Register the widget(s) for the public-facing side of the site. * diff --git a/src/public/widget/class-footnotes-widget-reference-container.php b/src/public/widget/class-footnotes-widget-reference-container.php index bb33473..1412381 100644 --- a/src/public/widget/class-footnotes-widget-reference-container.php +++ b/src/public/widget/class-footnotes-widget-reference-container.php @@ -25,7 +25,7 @@ class Footnotes_Widget_Reference_Container extends Footnotes_Widget_Base { * @var string $plugin_name The ID of this plugin. */ private $plugin_name; - + /** * Initialize the class and set its properties. *