Passed
Push — master ( e0a59a...75b6ac )
by Paul
06:30 queued 02:41
created
views/pages/welcome/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div class="glsr-welcome wrap about-wrap about-wrap-content">
4 4
     <h1>Welcome to <?= glsr()->name; ?></h1>
5 5
     <div class="about-text">Site Reviews is a free WordPress review plugin with advanced features that makes it easy to manage reviews on your website. Follow the instructions below to get started!</div>
6 6
     <div class="wp-badge">Version <?= glsr()->version; ?></div>
7 7
     <p class="about-buttons">
8
-        <a class="button" href="<?= admin_url('edit.php?post_type=site-review&page=documentation'); ?>">Documentation</a>
8
+        <a class="button" href="<?= admin_url( 'edit.php?post_type=site-review&page=documentation' ); ?>">Documentation</a>
9 9
         <a class="button" href="https://wordpress.org/support/plugin/site-reviews/">Support</a>
10 10
         <a target="_blank" class="button" href="https://www.facebook.com/sharer/sharer.php?u=https%3A//geminilabs.io/site-reviews"><span class="dashicons dashicons-facebook-alt"></span> Share</a>
11 11
         <a target="_blank" class="button" href="https://twitter.com/intent/tweet?text=Site Reviews is a fantastic WordPress review plugin with advanced features that makes it easy to manage reviews on your website.&url=https://geminilabs.io/site-reviews&hashtags=WordPress,reviewplugins,"><span class="dashicons dashicons-twitter"></span> Tweet</a>
12 12
     </p>
13 13
     <nav class="glsr-nav-tab-wrapper nav-tab-wrapper">
14
-        <?php foreach ($tabs as $id => $title) : ?>
14
+        <?php foreach( $tabs as $id => $title ) : ?>
15 15
         <a class="glsr-nav-tab nav-tab" href="#<?= $id; ?>"><?= $title; ?></a>
16 16
         <?php endforeach; ?>
17 17
     </nav>
18
-    <?php foreach ($tabs as $id => $title) : ?>
18
+    <?php foreach( $tabs as $id => $title ) : ?>
19 19
     <div class="glsr-nav-view ui-tabs-hide" id="<?= $id; ?>">
20
-        <?php $template->render('pages/welcome/'.$id, $data); ?>
20
+        <?php $template->render( 'pages/welcome/'.$id, $data ); ?>
21 21
     </div>
22 22
     <?php endforeach; ?>
23 23
     <input type="hidden" name="_active_tab">
Please login to merge, or discard this patch.
views/pages/documentation/hooks.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <p>Hooks (also known as <a href="https://developer.wordpress.org/plugins/hooks/index.html">Actions and Filters</a>) are used in your theme's <code>functions.php</code> file to make changes to the plugin.</p>
4 4
 
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
     <div class="glsr-card-header">
7 7
         <h3>Customise the order of the fields in the review submission form</h3>
8 8
         <button type="button" class="handlediv" aria-expanded="true">
9
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
9
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
10 10
             <span class="toggle-indicator" aria-hidden="true"></span>
11 11
         </button>
12 12
     </div>
13 13
     <div class="inside">
14 14
         <p>Use this hook to customise the order of the fields in the review submission form used by Site Reviews.</p>
15
-        <p>See the <code><a data-expand="#faq-07" href="<?= admin_url('edit.php?post_type=site-review&page=documentation#!faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
15
+        <p>See the <code><a data-expand="#faq-07" href="<?= admin_url( 'edit.php?post_type=site-review&page=documentation#!faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
16 16
         <pre><code class="php">/**
17 17
  * Customises the order of the fields used in the Site Reviews submission form.
18 18
  * Paste this in your active theme's functions.php file.
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
     <div class="glsr-card-header">
31 31
         <h3>Customise the star images</h3>
32 32
         <button type="button" class="handlediv" aria-expanded="true">
33
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
33
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
34 34
             <span class="toggle-indicator" aria-hidden="true"></span>
35 35
         </button>
36 36
     </div>
37 37
     <div class="inside">
38 38
         <p>Use this hook to customise the star images used by Site Reviews.</p>
39
-        <p>See the <code><a data-expand="#faq-11" href="<?= admin_url('edit.php?post_type=site-review&page=documentation#!faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
39
+        <p>See the <code><a data-expand="#faq-11" href="<?= admin_url( 'edit.php?post_type=site-review&page=documentation#!faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
40 40
         <pre><code class="php">/**
41 41
  * Customises the stars used by Site Reviews.
42 42
  * Paste this in your active theme's functions.php file.
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     <div class="glsr-card-header">
55 55
         <h3>Disable the plugin javascript</h3>
56 56
         <button type="button" class="handlediv" aria-expanded="true">
57
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
57
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
58 58
             <span class="toggle-indicator" aria-hidden="true"></span>
59 59
         </button>
60 60
     </div>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     <div class="glsr-card-header">
74 74
         <h3>Disable the plugin stylesheet</h3>
75 75
         <button type="button" class="handlediv" aria-expanded="true">
76
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
76
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
77 77
             <span class="toggle-indicator" aria-hidden="true"></span>
78 78
         </button>
79 79
     </div>
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     <div class="glsr-card-header">
93 93
         <h3>Disable the polyfill.io script</h3>
94 94
         <button type="button" class="handlediv" aria-expanded="true">
95
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
95
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
96 96
             <span class="toggle-indicator" aria-hidden="true"></span>
97 97
         </button>
98 98
     </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     <div class="glsr-card-header">
113 113
         <h3>Do something immediately after a review has been submitted</h3>
114 114
         <button type="button" class="handlediv" aria-expanded="true">
115
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
115
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
116 116
             <span class="toggle-indicator" aria-hidden="true"></span>
117 117
         </button>
118 118
     </div>
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
     <div class="glsr-card-header">
137 137
         <h3>Modify the schema</h3>
138 138
         <button type="button" class="handlediv" aria-expanded="true">
139
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
139
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
140 140
             <span class="toggle-indicator" aria-hidden="true"></span>
141 141
         </button>
142 142
     </div>
143 143
     <div class="inside">
144 144
         <p>Use this hook if you would like to modify the schema type properties.</p>
145 145
         <p>This hook is specific to the schema type. For example, to modify the schema properties for the LocalBusiness schema type you would use the <code>site-reviews/schema/LocalBusiness</code> hook, but to modify the schema properties for the Product schema type you would use the <code>site-reviews/schema/Product</code> hook.</p>
146
-        <p>See the <code><a data-expand="#faq-01" href="<?= admin_url('edit.php?post_type=site-review&page=documentation#!faq'); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
146
+        <p>See the <code><a data-expand="#faq-01" href="<?= admin_url( 'edit.php?post_type=site-review&page=documentation#!faq' ); ?>">FAQ</a></code> for a detailed example of how to use this hook.</p>
147 147
         <p>Make sure to use Google's <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test the schema after any custom modifications have been made.</p>
148 148
         <pre><code class="php">/**
149 149
  * Modifies the properties of the schema created by Site Reviews.
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     <div class="glsr-card-header">
164 164
         <h3>Modify the submitted review before it is saved</h3>
165 165
         <button type="button" class="handlediv" aria-expanded="true">
166
-            <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span>
166
+            <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span>
167 167
             <span class="toggle-indicator" aria-hidden="true"></span>
168 168
         </button>
169 169
     </div>
Please login to merge, or discard this patch.
views/pages/settings/schema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1
-<?php defined('WPINC') || die; ?>
1
+<?php defined( 'WPINC' ) || die; ?>
2 2
 
3
-<p><?= __('The JSON-LD schema is disabled by default. To use it, please enable the option in your blocks or shortcodes. The schema appears in Google\'s search results and shows the star rating and other information about your reviews. If the schema has been enabled, you can use Google\'s <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test your pages for valid schema data.', 'site-reviews'); ?></p>
4
-<p><?= __('You may override any of these options on a per-post/page basis by using its Custom Field name and adding a custom value using the <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a> metabox.', 'site-reviews'); ?></p>
3
+<p><?= __( 'The JSON-LD schema is disabled by default. To use it, please enable the option in your blocks or shortcodes. The schema appears in Google\'s search results and shows the star rating and other information about your reviews. If the schema has been enabled, you can use Google\'s <a href="https://search.google.com/structured-data/testing-tool">Structured Data Testing Tool</a> to test your pages for valid schema data.', 'site-reviews' ); ?></p>
4
+<p><?= __( 'You may override any of these options on a per-post/page basis by using its Custom Field name and adding a custom value using the <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a> metabox.', 'site-reviews' ); ?></p>
5 5
 <table class="form-table">
6 6
     <tbody>
7 7
         {{ rows }}
Please login to merge, or discard this patch.
plugin/Actions.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
     protected $taxonomy;
34 34
     protected $welcome;
35 35
 
36
-    public function __construct(Application $app ) {
36
+    public function __construct(Application $app )
37
+    {
37 38
         $this->app = $app;
38 39
         $this->admin = $app->make(AdminController::class);
39 40
         $this->blocks = $app->make(BlocksController::class);
Please login to merge, or discard this patch.
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -20,108 +20,108 @@
 block discarded – undo
20 20
 
21 21
 class Actions implements HooksContract
22 22
 {
23
-    protected $about;
24
-    protected $admin;
25
-    protected $app;
26
-    protected $blocks;
27
-    protected $console;
28
-    protected $editor;
29
-    protected $listtable;
30
-    protected $menu;
31
-    protected $main;
32
-    protected $notices;
33
-    protected $public;
34
-    protected $rebusify;
35
-    protected $review;
36
-    protected $router;
37
-    protected $settings;
38
-    protected $taxonomy;
39
-    protected $welcome;
23
+	protected $about;
24
+	protected $admin;
25
+	protected $app;
26
+	protected $blocks;
27
+	protected $console;
28
+	protected $editor;
29
+	protected $listtable;
30
+	protected $menu;
31
+	protected $main;
32
+	protected $notices;
33
+	protected $public;
34
+	protected $rebusify;
35
+	protected $review;
36
+	protected $router;
37
+	protected $settings;
38
+	protected $taxonomy;
39
+	protected $welcome;
40 40
 
41
-    public function __construct(Application $app ) {
42
-        $this->app = $app;
43
-        $this->admin = $app->make(AdminController::class);
44
-        $this->blocks = $app->make(BlocksController::class);
45
-        $this->console = $app->make(Console::class);
46
-        $this->editor = $app->make(EditorController::class);
47
-        $this->listtable = $app->make(ListTableController::class);
48
-        $this->main = $app->make(MainController::class);
49
-        $this->menu = $app->make(MenuController::class);
50
-        $this->notices = $app->make(NoticeController::class);
51
-        $this->public = $app->make(PublicController::class);
52
-        $this->rebusify = $app->make(RebusifyController::class);
53
-        $this->review = $app->make(ReviewController::class);
54
-        $this->router = $app->make(Router::class);
55
-        $this->settings = $app->make(SettingsController::class);
56
-        $this->taxonomy = $app->make(TaxonomyController::class);
57
-        $this->welcome = $app->make(WelcomeController::class);
58
-    }
41
+	public function __construct(Application $app ) {
42
+		$this->app = $app;
43
+		$this->admin = $app->make(AdminController::class);
44
+		$this->blocks = $app->make(BlocksController::class);
45
+		$this->console = $app->make(Console::class);
46
+		$this->editor = $app->make(EditorController::class);
47
+		$this->listtable = $app->make(ListTableController::class);
48
+		$this->main = $app->make(MainController::class);
49
+		$this->menu = $app->make(MenuController::class);
50
+		$this->notices = $app->make(NoticeController::class);
51
+		$this->public = $app->make(PublicController::class);
52
+		$this->rebusify = $app->make(RebusifyController::class);
53
+		$this->review = $app->make(ReviewController::class);
54
+		$this->router = $app->make(Router::class);
55
+		$this->settings = $app->make(SettingsController::class);
56
+		$this->taxonomy = $app->make(TaxonomyController::class);
57
+		$this->welcome = $app->make(WelcomeController::class);
58
+	}
59 59
 
60
-    /**
61
-     * @return void
62
-     */
63
-    public function run()
64
-    {
65
-        add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
66
-        add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
67
-        add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
68
-        add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
69
-        add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
70
-        add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
71
-        add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
72
-        add_action('upgrader_process_complete',                             [$this->app, 'upgraded'], 10, 2);
73
-        add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
74
-        add_action('init',                                                  [$this->blocks, 'registerBlocks']);
75
-        add_action('admin_footer',                                          [$this->console, 'logOnce']);
76
-        add_action('wp_footer',                                             [$this->console, 'logOnce']);
77
-        add_action('admin_enqueue_scripts',                                 [$this->editor, 'customizePostStatusLabels']);
78
-        add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
79
-        add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
80
-        add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
81
-        add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
82
-        add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
83
-        add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
84
-        add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
85
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
86
-        add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
87
-        add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
88
-        add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
89
-        add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
90
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
91
-        add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
92
-        add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
93
-        add_action('init',                                                  [$this->main, 'registerPostType'], 8);
94
-        add_action('init',                                                  [$this->main, 'registerShortcodes']);
95
-        add_action('init',                                                  [$this->main, 'registerTaxonomy']);
96
-        add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
97
-        add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
98
-        add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
99
-        add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
100
-        add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
101
-        add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
102
-        add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
103
-        add_action('wp_footer',                                             [$this->public, 'renderSchema']);
104
-        add_action('site-reviews/review/created',                           [$this->rebusify, 'onCreated']);
105
-        add_action('site-reviews/review/reverted',                          [$this->rebusify, 'onReverted']);
106
-        add_action('site-reviews/review/saved',                             [$this->rebusify, 'onSaved']);
107
-        add_action('updated_postmeta',                                      [$this->rebusify, 'onUpdatedMeta'], 10, 3);
108
-        add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
109
-        add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
110
-        add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
111
-        add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
112
-        add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
113
-        add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
114
-        add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
115
-        add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
116
-        add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
117
-        add_action('admin_init',                                            [$this->settings, 'registerSettings']);
118
-        add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
119
-        add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
120
-        add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
121
-        add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
122
-        add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
123
-        add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
124
-        add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
125
-        add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
126
-    }
60
+	/**
61
+	 * @return void
62
+	 */
63
+	public function run()
64
+	{
65
+		add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
66
+		add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
67
+		add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
68
+		add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
69
+		add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
70
+		add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
71
+		add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
72
+		add_action('upgrader_process_complete',                             [$this->app, 'upgraded'], 10, 2);
73
+		add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
74
+		add_action('init',                                                  [$this->blocks, 'registerBlocks']);
75
+		add_action('admin_footer',                                          [$this->console, 'logOnce']);
76
+		add_action('wp_footer',                                             [$this->console, 'logOnce']);
77
+		add_action('admin_enqueue_scripts',                                 [$this->editor, 'customizePostStatusLabels']);
78
+		add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
79
+		add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
80
+		add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
81
+		add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
82
+		add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
83
+		add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
84
+		add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
85
+		add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
86
+		add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
87
+		add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
88
+		add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
89
+		add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
90
+		add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
91
+		add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
92
+		add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
93
+		add_action('init',                                                  [$this->main, 'registerPostType'], 8);
94
+		add_action('init',                                                  [$this->main, 'registerShortcodes']);
95
+		add_action('init',                                                  [$this->main, 'registerTaxonomy']);
96
+		add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
97
+		add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
98
+		add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
99
+		add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
100
+		add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
101
+		add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
102
+		add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
103
+		add_action('wp_footer',                                             [$this->public, 'renderSchema']);
104
+		add_action('site-reviews/review/created',                           [$this->rebusify, 'onCreated']);
105
+		add_action('site-reviews/review/reverted',                          [$this->rebusify, 'onReverted']);
106
+		add_action('site-reviews/review/saved',                             [$this->rebusify, 'onSaved']);
107
+		add_action('updated_postmeta',                                      [$this->rebusify, 'onUpdatedMeta'], 10, 3);
108
+		add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
109
+		add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
110
+		add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
111
+		add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
112
+		add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
113
+		add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
114
+		add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
115
+		add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
116
+		add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
117
+		add_action('admin_init',                                            [$this->settings, 'registerSettings']);
118
+		add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
119
+		add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
120
+		add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
121
+		add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
122
+		add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
123
+		add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
124
+		add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
125
+		add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
126
+	}
127 127
 }
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -38,23 +38,23 @@  discard block
 block discarded – undo
38 38
     protected $taxonomy;
39 39
     protected $welcome;
40 40
 
41
-    public function __construct(Application $app ) {
41
+    public function __construct( Application $app ) {
42 42
         $this->app = $app;
43
-        $this->admin = $app->make(AdminController::class);
44
-        $this->blocks = $app->make(BlocksController::class);
45
-        $this->console = $app->make(Console::class);
46
-        $this->editor = $app->make(EditorController::class);
47
-        $this->listtable = $app->make(ListTableController::class);
48
-        $this->main = $app->make(MainController::class);
49
-        $this->menu = $app->make(MenuController::class);
50
-        $this->notices = $app->make(NoticeController::class);
51
-        $this->public = $app->make(PublicController::class);
52
-        $this->rebusify = $app->make(RebusifyController::class);
53
-        $this->review = $app->make(ReviewController::class);
54
-        $this->router = $app->make(Router::class);
55
-        $this->settings = $app->make(SettingsController::class);
56
-        $this->taxonomy = $app->make(TaxonomyController::class);
57
-        $this->welcome = $app->make(WelcomeController::class);
43
+        $this->admin = $app->make( AdminController::class );
44
+        $this->blocks = $app->make( BlocksController::class );
45
+        $this->console = $app->make( Console::class );
46
+        $this->editor = $app->make( EditorController::class );
47
+        $this->listtable = $app->make( ListTableController::class );
48
+        $this->main = $app->make( MainController::class );
49
+        $this->menu = $app->make( MenuController::class );
50
+        $this->notices = $app->make( NoticeController::class );
51
+        $this->public = $app->make( PublicController::class );
52
+        $this->rebusify = $app->make( RebusifyController::class );
53
+        $this->review = $app->make( ReviewController::class );
54
+        $this->router = $app->make( Router::class );
55
+        $this->settings = $app->make( SettingsController::class );
56
+        $this->taxonomy = $app->make( TaxonomyController::class );
57
+        $this->welcome = $app->make( WelcomeController::class );
58 58
     }
59 59
 
60 60
     /**
@@ -62,66 +62,66 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function run()
64 64
     {
65
-        add_action('admin_enqueue_scripts',                                 [$this->admin, 'enqueueAssets']);
66
-        add_action('admin_init',                                            [$this->admin, 'registerTinymcePopups']);
67
-        add_action('media_buttons',                                         [$this->admin, 'renderTinymceButton'], 11);
68
-        add_action('plugins_loaded',                                        [$this->app, 'getDefaults'], 11);
69
-        add_action('plugins_loaded',                                        [$this->app, 'registerAddons']);
70
-        add_action('plugins_loaded',                                        [$this->app, 'registerLanguages']);
71
-        add_action('plugins_loaded',                                        [$this->app, 'registerReviewTypes']);
72
-        add_action('upgrader_process_complete',                             [$this->app, 'upgraded'], 10, 2);
73
-        add_action('init',                                                  [$this->blocks, 'registerAssets'], 9);
74
-        add_action('init',                                                  [$this->blocks, 'registerBlocks']);
75
-        add_action('admin_footer',                                          [$this->console, 'logOnce']);
76
-        add_action('wp_footer',                                             [$this->console, 'logOnce']);
77
-        add_action('admin_enqueue_scripts',                                 [$this->editor, 'customizePostStatusLabels']);
78
-        add_action('add_meta_boxes_'.Application::POST_TYPE,                [$this->editor, 'registerMetaBoxes']);
79
-        add_action('admin_print_scripts',                                   [$this->editor, 'removeAutosave'], 999);
80
-        add_action('admin_menu',                                            [$this->editor, 'removeMetaBoxes']);
81
-        add_action('current_screen',                                        [$this->editor, 'removePostTypeSupport']);
82
-        add_action('post_submitbox_misc_actions',                           [$this->editor, 'renderPinnedInPublishMetaBox']);
83
-        add_action('admin_head',                                            [$this->editor, 'renderReviewFields']);
84
-        add_action('admin_action_revert',                                   [$this->editor, 'revertReview']);
85
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->editor, 'saveMetaboxes'], 10, 3);
86
-        add_action('admin_action_approve',                                  [$this->listtable, 'approve']);
87
-        add_action('bulk_edit_custom_box',                                  [$this->listtable, 'renderBulkEditFields'], 10, 2);
88
-        add_action('restrict_manage_posts',                                 [$this->listtable, 'renderColumnFilters']);
89
-        add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2);
90
-        add_action('save_post_'.Application::POST_TYPE,                     [$this->listtable, 'saveBulkEditFields']);
91
-        add_action('pre_get_posts',                                         [$this->listtable, 'setQueryForColumn']);
92
-        add_action('admin_action_unapprove',                                [$this->listtable, 'unapprove']);
93
-        add_action('init',                                                  [$this->main, 'registerPostType'], 8);
94
-        add_action('init',                                                  [$this->main, 'registerShortcodes']);
95
-        add_action('init',                                                  [$this->main, 'registerTaxonomy']);
96
-        add_action('widgets_init',                                          [$this->main, 'registerWidgets']);
97
-        add_action('admin_menu',                                            [$this->menu, 'registerMenuCount']);
98
-        add_action('admin_menu',                                            [$this->menu, 'registerSubMenus']);
99
-        add_action('admin_init',                                            [$this->menu, 'setCustomPermissions'], 999);
100
-        add_action('admin_notices',                                         [$this->notices, 'filterAdminNotices']);
101
-        add_action('wp_enqueue_scripts',                                    [$this->public, 'enqueueAssets'], 999);
102
-        add_filter('site-reviews/builder',                                  [$this->public, 'modifyBuilder']);
103
-        add_action('wp_footer',                                             [$this->public, 'renderSchema']);
104
-        add_action('site-reviews/review/created',                           [$this->rebusify, 'onCreated']);
105
-        add_action('site-reviews/review/reverted',                          [$this->rebusify, 'onReverted']);
106
-        add_action('site-reviews/review/saved',                             [$this->rebusify, 'onSaved']);
107
-        add_action('updated_postmeta',                                      [$this->rebusify, 'onUpdatedMeta'], 10, 3);
108
-        add_action('set_object_terms',                                      [$this->review, 'onAfterChangeCategory'], 10, 6);
109
-        add_action('transition_post_status',                                [$this->review, 'onAfterChangeStatus'], 10, 3);
110
-        add_action('site-reviews/review/created',                           [$this->review, 'onAfterCreate']);
111
-        add_action('before_delete_post',                                    [$this->review, 'onBeforeDelete']);
112
-        add_action('update_postmeta',                                       [$this->review, 'onBeforeUpdate'], 10, 4);
113
-        add_action('admin_init',                                            [$this->router, 'routeAdminPostRequest']);
114
-        add_action('wp_ajax_'.Application::PREFIX.'action',                 [$this->router, 'routeAjaxRequest']);
115
-        add_action('wp_ajax_nopriv_'.Application::PREFIX.'action',          [$this->router, 'routeAjaxRequest']);
116
-        add_action('init',                                                  [$this->router, 'routePublicPostRequest']);
117
-        add_action('admin_init',                                            [$this->settings, 'registerSettings']);
118
-        add_action(Application::TAXONOMY.'_term_edit_form_top',             [$this->taxonomy, 'disableParents']);
119
-        add_action(Application::TAXONOMY.'_term_new_form_tag',              [$this->taxonomy, 'disableParents']);
120
-        add_action(Application::TAXONOMY.'_add_form_fields',                [$this->taxonomy, 'enableParents']);
121
-        add_action(Application::TAXONOMY.'_edit_form',                      [$this->taxonomy, 'enableParents']);
122
-        add_action('restrict_manage_posts',                                 [$this->taxonomy, 'renderTaxonomyFilter'], 9);
123
-        add_action('set_object_terms',                                      [$this->taxonomy, 'restrictTermSelection'], 9, 6);
124
-        add_action('activated_plugin',                                      [$this->welcome, 'redirectOnActivation'], 10, 2);
125
-        add_action('admin_menu',                                            [$this->welcome, 'registerPage']);
65
+        add_action( 'admin_enqueue_scripts', [$this->admin, 'enqueueAssets'] );
66
+        add_action( 'admin_init', [$this->admin, 'registerTinymcePopups'] );
67
+        add_action( 'media_buttons', [$this->admin, 'renderTinymceButton'], 11 );
68
+        add_action( 'plugins_loaded', [$this->app, 'getDefaults'], 11 );
69
+        add_action( 'plugins_loaded', [$this->app, 'registerAddons'] );
70
+        add_action( 'plugins_loaded', [$this->app, 'registerLanguages'] );
71
+        add_action( 'plugins_loaded', [$this->app, 'registerReviewTypes'] );
72
+        add_action( 'upgrader_process_complete', [$this->app, 'upgraded'], 10, 2 );
73
+        add_action( 'init', [$this->blocks, 'registerAssets'], 9 );
74
+        add_action( 'init', [$this->blocks, 'registerBlocks'] );
75
+        add_action( 'admin_footer', [$this->console, 'logOnce'] );
76
+        add_action( 'wp_footer', [$this->console, 'logOnce'] );
77
+        add_action( 'admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels'] );
78
+        add_action( 'add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes'] );
79
+        add_action( 'admin_print_scripts', [$this->editor, 'removeAutosave'], 999 );
80
+        add_action( 'admin_menu', [$this->editor, 'removeMetaBoxes'] );
81
+        add_action( 'current_screen', [$this->editor, 'removePostTypeSupport'] );
82
+        add_action( 'post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox'] );
83
+        add_action( 'admin_head', [$this->editor, 'renderReviewFields'] );
84
+        add_action( 'admin_action_revert', [$this->editor, 'revertReview'] );
85
+        add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'], 10, 3 );
86
+        add_action( 'admin_action_approve', [$this->listtable, 'approve'] );
87
+        add_action( 'bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2 );
88
+        add_action( 'restrict_manage_posts', [$this->listtable, 'renderColumnFilters'] );
89
+        add_action( 'manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2 );
90
+        add_action( 'save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields'] );
91
+        add_action( 'pre_get_posts', [$this->listtable, 'setQueryForColumn'] );
92
+        add_action( 'admin_action_unapprove', [$this->listtable, 'unapprove'] );
93
+        add_action( 'init', [$this->main, 'registerPostType'], 8 );
94
+        add_action( 'init', [$this->main, 'registerShortcodes'] );
95
+        add_action( 'init', [$this->main, 'registerTaxonomy'] );
96
+        add_action( 'widgets_init', [$this->main, 'registerWidgets'] );
97
+        add_action( 'admin_menu', [$this->menu, 'registerMenuCount'] );
98
+        add_action( 'admin_menu', [$this->menu, 'registerSubMenus'] );
99
+        add_action( 'admin_init', [$this->menu, 'setCustomPermissions'], 999 );
100
+        add_action( 'admin_notices', [$this->notices, 'filterAdminNotices'] );
101
+        add_action( 'wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999 );
102
+        add_filter( 'site-reviews/builder', [$this->public, 'modifyBuilder'] );
103
+        add_action( 'wp_footer', [$this->public, 'renderSchema'] );
104
+        add_action( 'site-reviews/review/created', [$this->rebusify, 'onCreated'] );
105
+        add_action( 'site-reviews/review/reverted', [$this->rebusify, 'onReverted'] );
106
+        add_action( 'site-reviews/review/saved', [$this->rebusify, 'onSaved'] );
107
+        add_action( 'updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 3 );
108
+        add_action( 'set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6 );
109
+        add_action( 'transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3 );
110
+        add_action( 'site-reviews/review/created', [$this->review, 'onAfterCreate'] );
111
+        add_action( 'before_delete_post', [$this->review, 'onBeforeDelete'] );
112
+        add_action( 'update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4 );
113
+        add_action( 'admin_init', [$this->router, 'routeAdminPostRequest'] );
114
+        add_action( 'wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
115
+        add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
116
+        add_action( 'init', [$this->router, 'routePublicPostRequest'] );
117
+        add_action( 'admin_init', [$this->settings, 'registerSettings'] );
118
+        add_action( Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents'] );
119
+        add_action( Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents'] );
120
+        add_action( Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents'] );
121
+        add_action( Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents'] );
122
+        add_action( 'restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9 );
123
+        add_action( 'set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6 );
124
+        add_action( 'activated_plugin', [$this->welcome, 'redirectOnActivation'], 10, 2 );
125
+        add_action( 'admin_menu', [$this->welcome, 'registerPage'] );
126 126
     }
127 127
 }
Please login to merge, or discard this patch.
site-reviews.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
 defined('WPINC') || die;
19 19
 
20 20
 if (!class_exists('GL_Plugin_Check_v3')) {
21
-    require_once __DIR__.'/activate.php';
21
+	require_once __DIR__.'/activate.php';
22 22
 }
23 23
 $check = new GL_Plugin_Check_v3(__FILE__);
24 24
 if (!$check->canProceed()) {
25
-    return;
25
+	return;
26 26
 }
27 27
 require_once __DIR__.'/autoload.php';
28 28
 require_once __DIR__.'/compatibility.php';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
  * Text Domain: site-reviews
16 16
  * Domain Path: languages
17 17
  */
18
-defined('WPINC') || die;
18
+defined( 'WPINC' ) || die;
19 19
 
20
-if (!class_exists('GL_Plugin_Check_v3')) {
20
+if( !class_exists( 'GL_Plugin_Check_v3' ) ) {
21 21
     require_once __DIR__.'/activate.php';
22 22
 }
23
-$check = new GL_Plugin_Check_v3(__FILE__);
24
-if (!$check->canProceed()) {
23
+$check = new GL_Plugin_Check_v3( __FILE__ );
24
+if( !$check->canProceed() ) {
25 25
     return;
26 26
 }
27 27
 require_once __DIR__.'/autoload.php';
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 require_once __DIR__.'/helpers.php';
31 31
 
32 32
 $app = new GeminiLabs\SiteReviews\Application();
33
-$app->make('Provider')->register($app);
34
-register_activation_hook(__FILE__, array($app, 'activate'));
35
-register_deactivation_hook(__FILE__, array($app, 'deactivate'));
36
-register_shutdown_function(array($app, 'catchFatalError'));
33
+$app->make( 'Provider' )->register( $app );
34
+register_activation_hook( __FILE__, array( $app, 'activate' ) );
35
+register_deactivation_hook( __FILE__, array( $app, 'deactivate' ) );
36
+register_shutdown_function( array( $app, 'catchFatalError' ) );
37 37
 $app->init();
Please login to merge, or discard this patch.
plugin/Modules/Notice.php 2 patches
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -8,112 +8,112 @@
 block discarded – undo
8 8
 
9 9
 class Notice
10 10
 {
11
-    /**
12
-     * @param string $type
13
-     * @param string|array|WP_Error $message
14
-     * @return void
15
-     */
16
-    public function add($type, $message, array $args = [])
17
-    {
18
-        if (empty(array_filter([$message, $type]))) {
19
-            return;
20
-        }
21
-        $args['message'] = $message;
22
-        $args['type'] = $type;
23
-        add_settings_error(Application::ID, '', json_encode($this->normalize($args)));
24
-    }
11
+	/**
12
+	 * @param string $type
13
+	 * @param string|array|WP_Error $message
14
+	 * @return void
15
+	 */
16
+	public function add($type, $message, array $args = [])
17
+	{
18
+		if (empty(array_filter([$message, $type]))) {
19
+			return;
20
+		}
21
+		$args['message'] = $message;
22
+		$args['type'] = $type;
23
+		add_settings_error(Application::ID, '', json_encode($this->normalize($args)));
24
+	}
25 25
 
26
-    /**
27
-     * @param string|array|WP_Error $message
28
-     * @return void
29
-     */
30
-    public function addError($message, array $args = [])
31
-    {
32
-        $this->add('error', $message, $args);
33
-    }
26
+	/**
27
+	 * @param string|array|WP_Error $message
28
+	 * @return void
29
+	 */
30
+	public function addError($message, array $args = [])
31
+	{
32
+		$this->add('error', $message, $args);
33
+	}
34 34
 
35
-    /**
36
-     * @param string|array|WP_Error $message
37
-     * @return void
38
-     */
39
-    public function addSuccess($message, array $args = [])
40
-    {
41
-        $this->add('success', $message, $args);
42
-    }
35
+	/**
36
+	 * @param string|array|WP_Error $message
37
+	 * @return void
38
+	 */
39
+	public function addSuccess($message, array $args = [])
40
+	{
41
+		$this->add('success', $message, $args);
42
+	}
43 43
 
44
-    /**
45
-     * @param string|array|WP_Error $message
46
-     * @return void
47
-     */
48
-    public function addWarning($message, array $args = [])
49
-    {
50
-        $this->add('warning', $message, $args);
51
-    }
44
+	/**
45
+	 * @param string|array|WP_Error $message
46
+	 * @return void
47
+	 */
48
+	public function addWarning($message, array $args = [])
49
+	{
50
+		$this->add('warning', $message, $args);
51
+	}
52 52
 
53
-    /**
54
-     * @return static
55
-     */
56
-    public function clear()
57
-    {
58
-        global $wp_settings_errors;
59
-        $wp_settings_errors = [];
60
-        delete_transient('settings_errors');
61
-        return $this;
62
-    }
53
+	/**
54
+	 * @return static
55
+	 */
56
+	public function clear()
57
+	{
58
+		global $wp_settings_errors;
59
+		$wp_settings_errors = [];
60
+		delete_transient('settings_errors');
61
+		return $this;
62
+	}
63 63
 
64
-    /**
65
-     * @return string
66
-     */
67
-    public function get()
68
-    {
69
-        $notices = array_map('unserialize',
70
-            array_unique(array_map('serialize', get_settings_errors(Application::ID)))
71
-        );
72
-        $notices = array_reduce($notices, function ($carry, $notice) {
73
-            return $carry.$this->buildNotice(json_decode($notice['message'], true));
74
-        });
75
-        return apply_filters('site-reviews/notices', $notices);
76
-    }
64
+	/**
65
+	 * @return string
66
+	 */
67
+	public function get()
68
+	{
69
+		$notices = array_map('unserialize',
70
+			array_unique(array_map('serialize', get_settings_errors(Application::ID)))
71
+		);
72
+		$notices = array_reduce($notices, function ($carry, $notice) {
73
+			return $carry.$this->buildNotice(json_decode($notice['message'], true));
74
+		});
75
+		return apply_filters('site-reviews/notices', $notices);
76
+	}
77 77
 
78
-    /**
79
-     * @return string
80
-     */
81
-    protected function buildNotice(array $args)
82
-    {
83
-        $messages = array_reduce($args['messages'], function ($carry, $message) {
84
-            return $carry.glsr(Builder::class)->p($message);
85
-        });
86
-        $class = 'notice notice-'.$args['type'];
87
-        if ($args['inline']) {
88
-            $class.= ' inline';
89
-        }
90
-        if ($args['dismissible']) {
91
-            $class.= ' is-dismissible';
92
-        }
93
-        return glsr(Builder::class)->div($messages, [
94
-            'class' => $class,
95
-        ]);
96
-    }
78
+	/**
79
+	 * @return string
80
+	 */
81
+	protected function buildNotice(array $args)
82
+	{
83
+		$messages = array_reduce($args['messages'], function ($carry, $message) {
84
+			return $carry.glsr(Builder::class)->p($message);
85
+		});
86
+		$class = 'notice notice-'.$args['type'];
87
+		if ($args['inline']) {
88
+			$class.= ' inline';
89
+		}
90
+		if ($args['dismissible']) {
91
+			$class.= ' is-dismissible';
92
+		}
93
+		return glsr(Builder::class)->div($messages, [
94
+			'class' => $class,
95
+		]);
96
+	}
97 97
 
98
-    /**
99
-     * @return array
100
-     */
101
-    protected function normalize(array $args)
102
-    {
103
-        $defaults = [
104
-            'dismissible' => true,
105
-            'inline' => true,
106
-            'message' => '',
107
-            'type' => '',
108
-        ];
109
-        $args = shortcode_atts($defaults, $args);
110
-        if (!in_array($args['type'], ['error', 'warning', 'success'])) {
111
-            $args['type'] = 'success';
112
-        }
113
-        $args['messages'] = is_wp_error($args['message'])
114
-            ? (array) $args['message']->get_error_message()
115
-            : (array) $args['message'];
116
-        unset($args['message']);
117
-        return $args;
118
-    }
98
+	/**
99
+	 * @return array
100
+	 */
101
+	protected function normalize(array $args)
102
+	{
103
+		$defaults = [
104
+			'dismissible' => true,
105
+			'inline' => true,
106
+			'message' => '',
107
+			'type' => '',
108
+		];
109
+		$args = shortcode_atts($defaults, $args);
110
+		if (!in_array($args['type'], ['error', 'warning', 'success'])) {
111
+			$args['type'] = 'success';
112
+		}
113
+		$args['messages'] = is_wp_error($args['message'])
114
+			? (array) $args['message']->get_error_message()
115
+			: (array) $args['message'];
116
+		unset($args['message']);
117
+		return $args;
118
+	}
119 119
 }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -13,41 +13,41 @@  discard block
 block discarded – undo
13 13
      * @param string|array|WP_Error $message
14 14
      * @return void
15 15
      */
16
-    public function add($type, $message, array $args = [])
16
+    public function add( $type, $message, array $args = [] )
17 17
     {
18
-        if (empty(array_filter([$message, $type]))) {
18
+        if( empty(array_filter( [$message, $type] )) ) {
19 19
             return;
20 20
         }
21 21
         $args['message'] = $message;
22 22
         $args['type'] = $type;
23
-        add_settings_error(Application::ID, '', json_encode($this->normalize($args)));
23
+        add_settings_error( Application::ID, '', json_encode( $this->normalize( $args ) ) );
24 24
     }
25 25
 
26 26
     /**
27 27
      * @param string|array|WP_Error $message
28 28
      * @return void
29 29
      */
30
-    public function addError($message, array $args = [])
30
+    public function addError( $message, array $args = [] )
31 31
     {
32
-        $this->add('error', $message, $args);
32
+        $this->add( 'error', $message, $args );
33 33
     }
34 34
 
35 35
     /**
36 36
      * @param string|array|WP_Error $message
37 37
      * @return void
38 38
      */
39
-    public function addSuccess($message, array $args = [])
39
+    public function addSuccess( $message, array $args = [] )
40 40
     {
41
-        $this->add('success', $message, $args);
41
+        $this->add( 'success', $message, $args );
42 42
     }
43 43
 
44 44
     /**
45 45
      * @param string|array|WP_Error $message
46 46
      * @return void
47 47
      */
48
-    public function addWarning($message, array $args = [])
48
+    public function addWarning( $message, array $args = [] )
49 49
     {
50
-        $this->add('warning', $message, $args);
50
+        $this->add( 'warning', $message, $args );
51 51
     }
52 52
 
53 53
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         global $wp_settings_errors;
59 59
         $wp_settings_errors = [];
60
-        delete_transient('settings_errors');
60
+        delete_transient( 'settings_errors' );
61 61
         return $this;
62 62
     }
63 63
 
@@ -66,39 +66,39 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function get()
68 68
     {
69
-        $notices = array_map('unserialize',
70
-            array_unique(array_map('serialize', get_settings_errors(Application::ID)))
69
+        $notices = array_map( 'unserialize',
70
+            array_unique( array_map( 'serialize', get_settings_errors( Application::ID ) ) )
71 71
         );
72
-        $notices = array_reduce($notices, function ($carry, $notice) {
73
-            return $carry.$this->buildNotice(json_decode($notice['message'], true));
72
+        $notices = array_reduce( $notices, function( $carry, $notice ) {
73
+            return $carry.$this->buildNotice( json_decode( $notice['message'], true ) );
74 74
         });
75
-        return apply_filters('site-reviews/notices', $notices);
75
+        return apply_filters( 'site-reviews/notices', $notices );
76 76
     }
77 77
 
78 78
     /**
79 79
      * @return string
80 80
      */
81
-    protected function buildNotice(array $args)
81
+    protected function buildNotice( array $args )
82 82
     {
83
-        $messages = array_reduce($args['messages'], function ($carry, $message) {
84
-            return $carry.glsr(Builder::class)->p($message);
83
+        $messages = array_reduce( $args['messages'], function( $carry, $message ) {
84
+            return $carry.glsr( Builder::class )->p( $message );
85 85
         });
86 86
         $class = 'notice notice-'.$args['type'];
87
-        if ($args['inline']) {
88
-            $class.= ' inline';
87
+        if( $args['inline'] ) {
88
+            $class .= ' inline';
89 89
         }
90
-        if ($args['dismissible']) {
91
-            $class.= ' is-dismissible';
90
+        if( $args['dismissible'] ) {
91
+            $class .= ' is-dismissible';
92 92
         }
93
-        return glsr(Builder::class)->div($messages, [
93
+        return glsr( Builder::class )->div( $messages, [
94 94
             'class' => $class,
95
-        ]);
95
+        ] );
96 96
     }
97 97
 
98 98
     /**
99 99
      * @return array
100 100
      */
101
-    protected function normalize(array $args)
101
+    protected function normalize( array $args )
102 102
     {
103 103
         $defaults = [
104 104
             'dismissible' => true,
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
             'message' => '',
107 107
             'type' => '',
108 108
         ];
109
-        $args = shortcode_atts($defaults, $args);
110
-        if (!in_array($args['type'], ['error', 'warning', 'success'])) {
109
+        $args = shortcode_atts( $defaults, $args );
110
+        if( !in_array( $args['type'], ['error', 'warning', 'success'] ) ) {
111 111
             $args['type'] = 'success';
112 112
         }
113
-        $args['messages'] = is_wp_error($args['message'])
114
-            ? (array) $args['message']->get_error_message()
115
-            : (array) $args['message'];
113
+        $args['messages'] = is_wp_error( $args['message'] )
114
+            ? (array)$args['message']->get_error_message()
115
+            : (array)$args['message'];
116 116
         unset($args['message']);
117 117
         return $args;
118 118
     }
Please login to merge, or discard this patch.
plugin/Modules/Html/Fields/Password.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 class Password extends Field
6 6
 {
7
-    /**
8
-     * @return array
9
-     */
10
-    public static function defaults()
11
-    {
12
-        return [
13
-            'class' => 'regular-text',
14
-        ];
15
-    }
7
+	/**
8
+	 * @return array
9
+	 */
10
+	public static function defaults()
11
+	{
12
+		return [
13
+			'class' => 'regular-text',
14
+		];
15
+	}
16 16
 }
Please login to merge, or discard this patch.
plugin/Modules/Rebusify.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,8 @@
 block discarded – undo
101 101
     {
102 102
         if (is_wp_error($response)) {
103 103
             $this->message = $response->get_error_message();
104
-        } else {
104
+        }
105
+        else {
105 106
             $responseBody = wp_remote_retrieve_body($response);
106 107
             $responseCode = wp_remote_retrieve_response_code($response);
107 108
             $responseData = (array) json_decode($responseBody, true);
Please login to merge, or discard this patch.
Indentation   +129 added lines, -129 removed lines patch added patch discarded remove patch
@@ -10,143 +10,143 @@
 block discarded – undo
10 10
 
11 11
 class Rebusify
12 12
 {
13
-    const API_URL = 'https://www.rebusify.com/api/rbs/';
14
-    const WEB_URL = 'https://rebusify.com/plans?ref=105';
13
+	const API_URL = 'https://www.rebusify.com/api/rbs/';
14
+	const WEB_URL = 'https://rebusify.com/plans?ref=105';
15 15
 
16
-    public $message;
17
-    public $response;
18
-    public $success;
16
+	public $message;
17
+	public $response;
18
+	public $success;
19 19
 
20
-    /**
21
-     * @return mixed
22
-     */
23
-    public function __get($key)
24
-    {
25
-        return property_exists($this, $key)
26
-            ? $this->$key
27
-            : Arr::get($this->response, $key, null);
28
-    }
20
+	/**
21
+	 * @return mixed
22
+	 */
23
+	public function __get($key)
24
+	{
25
+		return property_exists($this, $key)
26
+			? $this->$key
27
+			: Arr::get($this->response, $key, null);
28
+	}
29 29
 
30
-    /**
31
-     * @return self
32
-     */
33
-    public function activateKey($apiKey = '', $email = '')
34
-    {
35
-        $this->send('api_key_activation.php', [
36
-            'body' => [
37
-                'apikey' => $apiKey ?: 0,
38
-                'domain' => get_home_url(),
39
-                'email' => $email ?: 0,
40
-            ],
41
-        ]);
42
-        return $this;
43
-    }
30
+	/**
31
+	 * @return self
32
+	 */
33
+	public function activateKey($apiKey = '', $email = '')
34
+	{
35
+		$this->send('api_key_activation.php', [
36
+			'body' => [
37
+				'apikey' => $apiKey ?: 0,
38
+				'domain' => get_home_url(),
39
+				'email' => $email ?: 0,
40
+			],
41
+		]);
42
+		return $this;
43
+	}
44 44
 
45
-    /**
46
-     * @return self
47
-     */
48
-    public function reset()
49
-    {
50
-        $this->message = '';
51
-        $this->response = [];
52
-        $this->success = false;
53
-        return $this;
54
-    }
45
+	/**
46
+	 * @return self
47
+	 */
48
+	public function reset()
49
+	{
50
+		$this->message = '';
51
+		$this->response = [];
52
+		$this->success = false;
53
+		return $this;
54
+	}
55 55
 
56
-    /**
57
-     * @return self
58
-     */
59
-    public function sendReview(Review $review)
60
-    {
61
-        $this->send('index.php', [
62
-            'body' => $this->getBodyForReview($review),
63
-            'timeout' => 120,
64
-        ]);
65
-        return $this;
66
-    }
56
+	/**
57
+	 * @return self
58
+	 */
59
+	public function sendReview(Review $review)
60
+	{
61
+		$this->send('index.php', [
62
+			'body' => $this->getBodyForReview($review),
63
+			'timeout' => 120,
64
+		]);
65
+		return $this;
66
+	}
67 67
 
68
-    /**
69
-     * @return self
70
-     */
71
-    public function sendReviewResponse(Review $review)
72
-    {
73
-        $this->send('fetch_customer_reply.php', [
74
-            'body' => $this->getBodyForResponse($review),
75
-        ]);
76
-        return $this;
77
-    }
68
+	/**
69
+	 * @return self
70
+	 */
71
+	public function sendReviewResponse(Review $review)
72
+	{
73
+		$this->send('fetch_customer_reply.php', [
74
+			'body' => $this->getBodyForResponse($review),
75
+		]);
76
+		return $this;
77
+	}
78 78
 
79
-    /**
80
-     * @return array
81
-     */
82
-    protected function getBodyForResponse(Review $review)
83
-    {
84
-        $rebusifyResponse = [
85
-            'reply' => Str::truncate($review->response, 300),
86
-            'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID
87
-            'review_transaction_id' => $review->review_id,
88
-            'type' => 'M',
89
-        ];
90
-        return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review);
91
-    }
79
+	/**
80
+	 * @return array
81
+	 */
82
+	protected function getBodyForResponse(Review $review)
83
+	{
84
+		$rebusifyResponse = [
85
+			'reply' => Str::truncate($review->response, 300),
86
+			'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID
87
+			'review_transaction_id' => $review->review_id,
88
+			'type' => 'M',
89
+		];
90
+		return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review);
91
+	}
92 92
 
93
-    /**
94
-     * @return array
95
-     */
96
-    protected function getBodyForReview(Review $review)
97
-    {
98
-        $rebusifyReview = [
99
-            'domain' => get_home_url(),
100
-            'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25),
101
-            'rate' => $review->rating,
102
-            'review_transaction_id' => $review->review_id,
103
-            'reviews' => Str::truncate($review->content, 280),
104
-            'title' => Str::truncate($review->title, 35),
105
-            'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews
106
-        ];
107
-        return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review);
108
-    }
93
+	/**
94
+	 * @return array
95
+	 */
96
+	protected function getBodyForReview(Review $review)
97
+	{
98
+		$rebusifyReview = [
99
+			'domain' => get_home_url(),
100
+			'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25),
101
+			'rate' => $review->rating,
102
+			'review_transaction_id' => $review->review_id,
103
+			'reviews' => Str::truncate($review->content, 280),
104
+			'title' => Str::truncate($review->title, 35),
105
+			'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews
106
+		];
107
+		return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review);
108
+	}
109 109
 
110
-    /**
111
-     * @param \WP_Error|array $response
112
-     * @return void
113
-     */
114
-    protected function handleResponse($response)
115
-    {
116
-        if (is_wp_error($response)) {
117
-            $this->message = $response->get_error_message();
118
-        } else {
119
-            $responseBody = wp_remote_retrieve_body($response);
120
-            $responseCode = wp_remote_retrieve_response_code($response);
121
-            $responseData = (array) json_decode($responseBody, true);
122
-            $this->response = array_shift($responseData);
123
-            $this->message = Arr::get($this->response, 'msg');
124
-            $this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack!
125
-            if (200 !== $responseCode) {
126
-                glsr_log()->error('Bad response code ['.$responseCode.']');
127
-            }
128
-            if (!$this->success) {
129
-                glsr_log()->error($this->message);
130
-            }
131
-        }
132
-    }
110
+	/**
111
+	 * @param \WP_Error|array $response
112
+	 * @return void
113
+	 */
114
+	protected function handleResponse($response)
115
+	{
116
+		if (is_wp_error($response)) {
117
+			$this->message = $response->get_error_message();
118
+		} else {
119
+			$responseBody = wp_remote_retrieve_body($response);
120
+			$responseCode = wp_remote_retrieve_response_code($response);
121
+			$responseData = (array) json_decode($responseBody, true);
122
+			$this->response = array_shift($responseData);
123
+			$this->message = Arr::get($this->response, 'msg');
124
+			$this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack!
125
+			if (200 !== $responseCode) {
126
+				glsr_log()->error('Bad response code ['.$responseCode.']');
127
+			}
128
+			if (!$this->success) {
129
+				glsr_log()->error($this->message);
130
+			}
131
+		}
132
+	}
133 133
 
134
-    /**
135
-     * @param string $endpoint
136
-     * @return void
137
-     */
138
-    protected function send($endpoint, array $args = [])
139
-    {
140
-        $args = wp_parse_args($args, [
141
-            'body' => null,
142
-            'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
143
-            'redirection' => 5,
144
-            'sslverify' => false,
145
-            'timeout' => 5,
146
-        ]);
147
-        $this->reset();
148
-        $this->handleResponse(
149
-            wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args)
150
-        );
151
-    }
134
+	/**
135
+	 * @param string $endpoint
136
+	 * @return void
137
+	 */
138
+	protected function send($endpoint, array $args = [])
139
+	{
140
+		$args = wp_parse_args($args, [
141
+			'body' => null,
142
+			'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
143
+			'redirection' => 5,
144
+			'sslverify' => false,
145
+			'timeout' => 5,
146
+		]);
147
+		$this->reset();
148
+		$this->handleResponse(
149
+			wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args)
150
+		);
151
+	}
152 152
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,25 +20,25 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * @return mixed
22 22
      */
23
-    public function __get($key)
23
+    public function __get( $key )
24 24
     {
25
-        return property_exists($this, $key)
25
+        return property_exists( $this, $key )
26 26
             ? $this->$key
27
-            : Arr::get($this->response, $key, null);
27
+            : Arr::get( $this->response, $key, null );
28 28
     }
29 29
 
30 30
     /**
31 31
      * @return self
32 32
      */
33
-    public function activateKey($apiKey = '', $email = '')
33
+    public function activateKey( $apiKey = '', $email = '' )
34 34
     {
35
-        $this->send('api_key_activation.php', [
35
+        $this->send( 'api_key_activation.php', [
36 36
             'body' => [
37 37
                 'apikey' => $apiKey ?: 0,
38 38
                 'domain' => get_home_url(),
39 39
                 'email' => $email ?: 0,
40 40
             ],
41
-        ]);
41
+        ] );
42 42
         return $this;
43 43
     }
44 44
 
@@ -56,77 +56,77 @@  discard block
 block discarded – undo
56 56
     /**
57 57
      * @return self
58 58
      */
59
-    public function sendReview(Review $review)
59
+    public function sendReview( Review $review )
60 60
     {
61
-        $this->send('index.php', [
62
-            'body' => $this->getBodyForReview($review),
61
+        $this->send( 'index.php', [
62
+            'body' => $this->getBodyForReview( $review ),
63 63
             'timeout' => 120,
64
-        ]);
64
+        ] );
65 65
         return $this;
66 66
     }
67 67
 
68 68
     /**
69 69
      * @return self
70 70
      */
71
-    public function sendReviewResponse(Review $review)
71
+    public function sendReviewResponse( Review $review )
72 72
     {
73
-        $this->send('fetch_customer_reply.php', [
74
-            'body' => $this->getBodyForResponse($review),
75
-        ]);
73
+        $this->send( 'fetch_customer_reply.php', [
74
+            'body' => $this->getBodyForResponse( $review ),
75
+        ] );
76 76
         return $this;
77 77
     }
78 78
 
79 79
     /**
80 80
      * @return array
81 81
      */
82
-    protected function getBodyForResponse(Review $review)
82
+    protected function getBodyForResponse( Review $review )
83 83
     {
84 84
         $rebusifyResponse = [
85
-            'reply' => Str::truncate($review->response, 300),
86
-            'review_id' => glsr(Database::class)->get($review->ID, 'rebusify'), // this is the rebusify review ID
85
+            'reply' => Str::truncate( $review->response, 300 ),
86
+            'review_id' => glsr( Database::class )->get( $review->ID, 'rebusify' ), // this is the rebusify review ID
87 87
             'review_transaction_id' => $review->review_id,
88 88
             'type' => 'M',
89 89
         ];
90
-        return apply_filters('site-reviews/rebusify/response', $rebusifyResponse, $review);
90
+        return apply_filters( 'site-reviews/rebusify/response', $rebusifyResponse, $review );
91 91
     }
92 92
 
93 93
     /**
94 94
      * @return array
95 95
      */
96
-    protected function getBodyForReview(Review $review)
96
+    protected function getBodyForReview( Review $review )
97 97
     {
98 98
         $rebusifyReview = [
99 99
             'domain' => get_home_url(),
100
-            'firstname' => Str::truncate(Str::convertName($review->author, 'first'), 25),
100
+            'firstname' => Str::truncate( Str::convertName( $review->author, 'first' ), 25 ),
101 101
             'rate' => $review->rating,
102 102
             'review_transaction_id' => $review->review_id,
103
-            'reviews' => Str::truncate($review->content, 280),
104
-            'title' => Str::truncate($review->title, 35),
103
+            'reviews' => Str::truncate( $review->content, 280 ),
104
+            'title' => Str::truncate( $review->title, 35 ),
105 105
             'transaction' => Application::ID, // woocommerce field, not needed for Site Reviews
106 106
         ];
107
-        return apply_filters('site-reviews/rebusify/review', $rebusifyReview, $review);
107
+        return apply_filters( 'site-reviews/rebusify/review', $rebusifyReview, $review );
108 108
     }
109 109
 
110 110
     /**
111 111
      * @param \WP_Error|array $response
112 112
      * @return void
113 113
      */
114
-    protected function handleResponse($response)
114
+    protected function handleResponse( $response )
115 115
     {
116
-        if (is_wp_error($response)) {
116
+        if( is_wp_error( $response ) ) {
117 117
             $this->message = $response->get_error_message();
118 118
         } else {
119
-            $responseBody = wp_remote_retrieve_body($response);
120
-            $responseCode = wp_remote_retrieve_response_code($response);
121
-            $responseData = (array) json_decode($responseBody, true);
122
-            $this->response = array_shift($responseData);
123
-            $this->message = Arr::get($this->response, 'msg');
124
-            $this->success = 'success' === Arr::get($this->response, 'result') || 'yes' === Arr::get($this->response, 'success'); // @todo remove this ugly hack!
125
-            if (200 !== $responseCode) {
126
-                glsr_log()->error('Bad response code ['.$responseCode.']');
119
+            $responseBody = wp_remote_retrieve_body( $response );
120
+            $responseCode = wp_remote_retrieve_response_code( $response );
121
+            $responseData = (array)json_decode( $responseBody, true );
122
+            $this->response = array_shift( $responseData );
123
+            $this->message = Arr::get( $this->response, 'msg' );
124
+            $this->success = 'success' === Arr::get( $this->response, 'result' ) || 'yes' === Arr::get( $this->response, 'success' ); // @todo remove this ugly hack!
125
+            if( 200 !== $responseCode ) {
126
+                glsr_log()->error( 'Bad response code ['.$responseCode.']' );
127 127
             }
128
-            if (!$this->success) {
129
-                glsr_log()->error($this->message);
128
+            if( !$this->success ) {
129
+                glsr_log()->error( $this->message );
130 130
             }
131 131
         }
132 132
     }
@@ -135,18 +135,18 @@  discard block
 block discarded – undo
135 135
      * @param string $endpoint
136 136
      * @return void
137 137
      */
138
-    protected function send($endpoint, array $args = [])
138
+    protected function send( $endpoint, array $args = [] )
139 139
     {
140
-        $args = wp_parse_args($args, [
140
+        $args = wp_parse_args( $args, [
141 141
             'body' => null,
142 142
             'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'],
143 143
             'redirection' => 5,
144 144
             'sslverify' => false,
145 145
             'timeout' => 5,
146
-        ]);
146
+        ] );
147 147
         $this->reset();
148 148
         $this->handleResponse(
149
-            wp_remote_post(trailingslashit(static::API_URL).$endpoint, $args)
149
+            wp_remote_post( trailingslashit( static::API_URL ).$endpoint, $args )
150 150
         );
151 151
     }
152 152
 }
Please login to merge, or discard this patch.
plugin/Filters.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -14,69 +14,69 @@
 block discarded – undo
14 14
 
15 15
 class Filters implements HooksContract
16 16
 {
17
-    protected $admin;
18
-    protected $app;
19
-    protected $basename;
20
-    protected $blocks;
21
-    protected $editor;
22
-    protected $listtable;
23
-    protected $public;
24
-    protected $rebusify;
25
-    protected $translator;
26
-    protected $welcome;
17
+	protected $admin;
18
+	protected $app;
19
+	protected $basename;
20
+	protected $blocks;
21
+	protected $editor;
22
+	protected $listtable;
23
+	protected $public;
24
+	protected $rebusify;
25
+	protected $translator;
26
+	protected $welcome;
27 27
 
28
-    public function __construct(Application $app)
29
-    {
30
-        $this->app = $app;
31
-        $this->admin = $app->make(AdminController::class);
32
-        $this->basename = plugin_basename($app->file);
33
-        $this->blocks = $app->make(BlocksController::class);
34
-        $this->editor = $app->make(EditorController::class);
35
-        $this->listtable = $app->make(ListTableController::class);
36
-        $this->public = $app->make(PublicController::class);
37
-        $this->rebusify = $app->make(RebusifyController::class);
38
-        $this->translator = $app->make(Translator::class);
39
-        $this->welcome = $app->make(WelcomeController::class);
40
-    }
28
+	public function __construct(Application $app)
29
+	{
30
+		$this->app = $app;
31
+		$this->admin = $app->make(AdminController::class);
32
+		$this->basename = plugin_basename($app->file);
33
+		$this->blocks = $app->make(BlocksController::class);
34
+		$this->editor = $app->make(EditorController::class);
35
+		$this->listtable = $app->make(ListTableController::class);
36
+		$this->public = $app->make(PublicController::class);
37
+		$this->rebusify = $app->make(RebusifyController::class);
38
+		$this->translator = $app->make(Translator::class);
39
+		$this->welcome = $app->make(WelcomeController::class);
40
+	}
41 41
 
42
-    /**
43
-     * @return void
44
-     */
45
-    public function run()
46
-    {
47
-        add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
48
-        add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
49
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
50
-        add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
51
-        add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
52
-        add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
53
-        add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
54
-        add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
55
-        add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
56
-        add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
57
-        add_filter('gettext',                                                   [$this->editor, 'filterPostStatusLabels'], 10, 3);
58
-        add_filter('gettext_with_context',                                      [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4);
59
-        add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
60
-        add_filter('bulk_post_updated_messages',                                [$this->listtable, 'filterBulkUpdateMessages'], 10, 2);
61
-        add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
62
-        add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
63
-        add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
64
-        add_filter('display_post_states',                                       [$this->listtable, 'filterPostStates'], 10, 2);
65
-        add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
66
-        add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
67
-        add_filter('ngettext',                                                  [$this->listtable, 'filterStatusText'], 10, 5);
68
-        add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
69
-        add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
70
-        add_filter('query_vars',                                                [$this->public, 'filterQueryVars']);
71
-        add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
72
-        add_filter('site-reviews/settings/callback',                            [$this->rebusify, 'filterSettingsCallback']);
73
-        add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3);
74
-        add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 10, 3);
75
-        add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 10, 4);
76
-        add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 10, 5);
77
-        add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 10, 6);
78
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
79
-        add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
80
-        add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
81
-    }
42
+	/**
43
+	 * @return void
44
+	 */
45
+	public function run()
46
+	{
47
+		add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
48
+		add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
49
+		add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
50
+		add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
51
+		add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
52
+		add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
53
+		add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
54
+		add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
55
+		add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
56
+		add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
57
+		add_filter('gettext',                                                   [$this->editor, 'filterPostStatusLabels'], 10, 3);
58
+		add_filter('gettext_with_context',                                      [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4);
59
+		add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
60
+		add_filter('bulk_post_updated_messages',                                [$this->listtable, 'filterBulkUpdateMessages'], 10, 2);
61
+		add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
62
+		add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
63
+		add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
64
+		add_filter('display_post_states',                                       [$this->listtable, 'filterPostStates'], 10, 2);
65
+		add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
66
+		add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
67
+		add_filter('ngettext',                                                  [$this->listtable, 'filterStatusText'], 10, 5);
68
+		add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
69
+		add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
70
+		add_filter('query_vars',                                                [$this->public, 'filterQueryVars']);
71
+		add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
72
+		add_filter('site-reviews/settings/callback',                            [$this->rebusify, 'filterSettingsCallback']);
73
+		add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3);
74
+		add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 10, 3);
75
+		add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 10, 4);
76
+		add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 10, 5);
77
+		add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 10, 6);
78
+		add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
79
+		add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
80
+		add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
81
+	}
82 82
 }
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
     protected $translator;
26 26
     protected $welcome;
27 27
 
28
-    public function __construct(Application $app)
28
+    public function __construct( Application $app )
29 29
     {
30 30
         $this->app = $app;
31
-        $this->admin = $app->make(AdminController::class);
32
-        $this->basename = plugin_basename($app->file);
33
-        $this->blocks = $app->make(BlocksController::class);
34
-        $this->editor = $app->make(EditorController::class);
35
-        $this->listtable = $app->make(ListTableController::class);
36
-        $this->public = $app->make(PublicController::class);
37
-        $this->rebusify = $app->make(RebusifyController::class);
38
-        $this->translator = $app->make(Translator::class);
39
-        $this->welcome = $app->make(WelcomeController::class);
31
+        $this->admin = $app->make( AdminController::class );
32
+        $this->basename = plugin_basename( $app->file );
33
+        $this->blocks = $app->make( BlocksController::class );
34
+        $this->editor = $app->make( EditorController::class );
35
+        $this->listtable = $app->make( ListTableController::class );
36
+        $this->public = $app->make( PublicController::class );
37
+        $this->rebusify = $app->make( RebusifyController::class );
38
+        $this->translator = $app->make( Translator::class );
39
+        $this->welcome = $app->make( WelcomeController::class );
40 40
     }
41 41
 
42 42
     /**
@@ -44,39 +44,39 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function run()
46 46
     {
47
-        add_filter('map_meta_cap',                                              [$this->admin, 'filterCreateCapability'], 10, 2);
48
-        add_filter('mce_external_plugins',                                      [$this->admin, 'filterTinymcePlugins'], 15);
49
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->admin, 'filterActionLinks']);
50
-        add_filter('dashboard_glance_items',                                    [$this->admin, 'filterDashboardGlanceItems']);
51
-        add_filter('block_categories',                                          [$this->blocks, 'filterBlockCategories']);
52
-        add_filter('classic_editor_enabled_editors_for_post_type',              [$this->blocks, 'filterEnabledEditors'], 10, 2);
53
-        add_filter('use_block_editor_for_post_type',                            [$this->blocks, 'filterUseBlockEditor'], 10, 2);
54
-        add_filter('wp_editor_settings',                                        [$this->editor, 'filterEditorSettings']);
55
-        add_filter('the_editor',                                                [$this->editor, 'filterEditorTextarea']);
56
-        add_filter('is_protected_meta',                                         [$this->editor, 'filterIsProtectedMeta'], 10, 3);
57
-        add_filter('gettext',                                                   [$this->editor, 'filterPostStatusLabels'], 10, 3);
58
-        add_filter('gettext_with_context',                                      [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4);
59
-        add_filter('post_updated_messages',                                     [$this->editor, 'filterUpdateMessages']);
60
-        add_filter('bulk_post_updated_messages',                                [$this->listtable, 'filterBulkUpdateMessages'], 10, 2);
61
-        add_filter('manage_'.Application::POST_TYPE.'_posts_columns',           [$this->listtable, 'filterColumnsForPostType']);
62
-        add_filter('post_date_column_status',                                   [$this->listtable, 'filterDateColumnStatus'], 10, 2);
63
-        add_filter('default_hidden_columns',                                    [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2);
64
-        add_filter('display_post_states',                                       [$this->listtable, 'filterPostStates'], 10, 2);
65
-        add_filter('post_row_actions',                                          [$this->listtable, 'filterRowActions'], 10, 2);
66
-        add_filter('manage_edit-'.Application::POST_TYPE.'_sortable_columns',   [$this->listtable, 'filterSortableColumns']);
67
-        add_filter('ngettext',                                                  [$this->listtable, 'filterStatusText'], 10, 5);
68
-        add_filter('script_loader_tag',                                         [$this->public, 'filterEnqueuedScripts'], 10, 2);
69
-        add_filter('site-reviews/config/forms/submission-form',                 [$this->public, 'filterFieldOrder'], 11);
70
-        add_filter('query_vars',                                                [$this->public, 'filterQueryVars']);
71
-        add_filter('site-reviews/render/view',                                  [$this->public, 'filterRenderView']);
72
-        add_filter('site-reviews/settings/callback',                            [$this->rebusify, 'filterSettingsCallback']);
73
-        add_filter('site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3);
74
-        add_filter('gettext',                                                   [$this->translator, 'filterGettext'], 10, 3);
75
-        add_filter('gettext_with_context',                                      [$this->translator, 'filterGettextWithContext'], 10, 4);
76
-        add_filter('ngettext',                                                  [$this->translator, 'filterNgettext'], 10, 5);
77
-        add_filter('ngettext_with_context',                                     [$this->translator, 'filterNgettextWithContext'], 10, 6);
78
-        add_filter('plugin_action_links_'.$this->basename,                      [$this->welcome, 'filterActionLinks'], 9);
79
-        add_filter('admin_title',                                               [$this->welcome, 'filterAdminTitle']);
80
-        add_filter('admin_footer_text',                                         [$this->welcome, 'filterFooterText']);
47
+        add_filter( 'map_meta_cap', [$this->admin, 'filterCreateCapability'], 10, 2 );
48
+        add_filter( 'mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15 );
49
+        add_filter( 'plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks'] );
50
+        add_filter( 'dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems'] );
51
+        add_filter( 'block_categories', [$this->blocks, 'filterBlockCategories'] );
52
+        add_filter( 'classic_editor_enabled_editors_for_post_type', [$this->blocks, 'filterEnabledEditors'], 10, 2 );
53
+        add_filter( 'use_block_editor_for_post_type', [$this->blocks, 'filterUseBlockEditor'], 10, 2 );
54
+        add_filter( 'wp_editor_settings', [$this->editor, 'filterEditorSettings'] );
55
+        add_filter( 'the_editor', [$this->editor, 'filterEditorTextarea'] );
56
+        add_filter( 'is_protected_meta', [$this->editor, 'filterIsProtectedMeta'], 10, 3 );
57
+        add_filter( 'gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3 );
58
+        add_filter( 'gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 );
59
+        add_filter( 'post_updated_messages', [$this->editor, 'filterUpdateMessages'] );
60
+        add_filter( 'bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 );
61
+        add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType'] );
62
+        add_filter( 'post_date_column_status', [$this->listtable, 'filterDateColumnStatus'], 10, 2 );
63
+        add_filter( 'default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
64
+        add_filter( 'display_post_states', [$this->listtable, 'filterPostStates'], 10, 2 );
65
+        add_filter( 'post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2 );
66
+        add_filter( 'manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns'] );
67
+        add_filter( 'ngettext', [$this->listtable, 'filterStatusText'], 10, 5 );
68
+        add_filter( 'script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2 );
69
+        add_filter( 'site-reviews/config/forms/submission-form', [$this->public, 'filterFieldOrder'], 11 );
70
+        add_filter( 'query_vars', [$this->public, 'filterQueryVars'] );
71
+        add_filter( 'site-reviews/render/view', [$this->public, 'filterRenderView'] );
72
+        add_filter( 'site-reviews/settings/callback', [$this->rebusify, 'filterSettingsCallback'] );
73
+        add_filter( 'site-reviews/interpolate/partials/form/table-row-multiple', [$this->rebusify, 'filterSettingsTableRow'], 10, 3 );
74
+        add_filter( 'gettext', [$this->translator, 'filterGettext'], 10, 3 );
75
+        add_filter( 'gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4 );
76
+        add_filter( 'ngettext', [$this->translator, 'filterNgettext'], 10, 5 );
77
+        add_filter( 'ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6 );
78
+        add_filter( 'plugin_action_links_'.$this->basename, [$this->welcome, 'filterActionLinks'], 9 );
79
+        add_filter( 'admin_title', [$this->welcome, 'filterAdminTitle'] );
80
+        add_filter( 'admin_footer_text', [$this->welcome, 'filterFooterText'] );
81 81
     }
82 82
 }
Please login to merge, or discard this patch.