Passed
Push — master ( a2f0ba...28a5cf )
by Paul
05:03
created
plugin/Handlers/EnqueuePublicAssets.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@
 block discarded – undo
47 47
 	 */
48 48
 	public function enqueueRecaptchaScript()
49 49
 	{
50
-		if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' )return;
50
+		if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' ) {
51
+			return;
52
+		}
51 53
 		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([
52 54
 			'hl' => apply_filters( 'site-reviews/recaptcha/language', get_locale() ),
53 55
 			'onload' => 'glsr_render_recaptcha',
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	public function enqueueAssets()
25 25
 	{
26
-		if( apply_filters( 'site-reviews/assets/css', true )) {
26
+		if( apply_filters( 'site-reviews/assets/css', true ) ) {
27 27
 			wp_enqueue_style(
28 28
 				Application::ID,
29 29
 				$this->getStylesheet(),
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 				glsr()->version
32 32
 			);
33 33
 		}
34
-		if( apply_filters( 'site-reviews/assets/js', true )) {
34
+		if( apply_filters( 'site-reviews/assets/js', true ) ) {
35 35
 			wp_enqueue_script(
36 36
 				Application::ID,
37 37
 				glsr()->url( 'assets/scripts/'.Application::ID.'.js' ),
38
-				[],//glsr( Html::class )->getDependencies(),
38
+				[], //glsr( Html::class )->getDependencies(),
39 39
 				glsr()->version,
40 40
 				true
41 41
 			);
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 	public function enqueueRecaptchaScript()
49 49
 	{
50 50
 		if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' )return;
51
-		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([
51
+		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg( [
52 52
 			'hl' => apply_filters( 'site-reviews/recaptcha/language', get_locale() ),
53 53
 			'onload' => 'glsr_render_recaptcha',
54 54
 			'render' => 'explicit',
55
-		], 'https://www.google.com/recaptcha/api.js' ));
56
-		$inlineScript = file_get_contents( glsr()->path( 'assets/scripts/recaptcha.js' ));
55
+		], 'https://www.google.com/recaptcha/api.js' ) );
56
+		$inlineScript = file_get_contents( glsr()->path( 'assets/scripts/recaptcha.js' ) );
57 57
 		wp_add_inline_script( Application::ID.'/google-recaptcha', $inlineScript, 'before' );
58 58
 	}
59 59
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$variables = [
66 66
 			'action' => Application::PREFIX.'action',
67 67
 			'ajaxnonce' => wp_create_nonce( Application::ID.'-ajax-nonce' ),
68
-			'ajaxpagination' => ['#wpadminbar','.site-navigation-fixed'],
68
+			'ajaxpagination' => ['#wpadminbar', '.site-navigation-fixed'],
69 69
 			'ajaxurl' => admin_url( 'admin-ajax.php' ),
70 70
 		];
71 71
 		$variables = apply_filters( 'site-reviews/enqueue/localize', $variables );
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	protected function getStylesheet()
79 79
 	{
80
-		$currentTheme = sanitize_title( (string)wp_get_theme()->get( 'Name' ));
80
+		$currentTheme = sanitize_title( (string)wp_get_theme()->get( 'Name' ) );
81 81
 		return file_exists( glsr()->path.'assets/styles/'.$currentTheme.'.css' )
82 82
 			? glsr()->url( 'assets/styles/'.$currentTheme.'.css' )
83 83
 			: glsr()->url( 'assets/styles/'.Application::ID.'.css' );
Please login to merge, or discard this patch.
plugin/Filters.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -38,25 +38,25 @@
 block discarded – undo
38 38
 	 */
39 39
 	public function run()
40 40
 	{
41
-		add_filter( 'mce_external_plugins',                                    [$this->admin, 'filterTinymcePlugins'], 15 );
42
-		add_filter( 'plugin_action_links_'.$this->basename,                    [$this->admin, 'filterActionLinks'] );
43
-		add_filter( 'dashboard_glance_items',                                  [$this->admin, 'filterDashboardGlanceItems'] );
44
-		add_filter( 'wp_editor_settings',                                      [$this->editor, 'filterEditorSettings'] );
45
-		add_filter( 'the_editor',                                              [$this->editor, 'filterEditorTextarea'] );
46
-		add_filter( 'gettext',                                                 [$this->editor, 'filterPostStatusLabels'], 10, 3 );
47
-		add_filter( 'gettext_with_context',                                    [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 );
48
-		add_filter( 'post_updated_messages',                                   [$this->editor, 'filterUpdateMessages'] );
49
-		add_filter( 'bulk_post_updated_messages',                              [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 );
50
-		add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns',         [$this->listtable, 'filterColumnsForPostType'] );
51
-		add_filter( 'default_hidden_columns',                                  [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
52
-		add_filter( 'post_row_actions',                                        [$this->listtable, 'filterRowActions'], 10, 2 );
41
+		add_filter( 'mce_external_plugins', [$this->admin, 'filterTinymcePlugins'], 15 );
42
+		add_filter( 'plugin_action_links_'.$this->basename, [$this->admin, 'filterActionLinks'] );
43
+		add_filter( 'dashboard_glance_items', [$this->admin, 'filterDashboardGlanceItems'] );
44
+		add_filter( 'wp_editor_settings', [$this->editor, 'filterEditorSettings'] );
45
+		add_filter( 'the_editor', [$this->editor, 'filterEditorTextarea'] );
46
+		add_filter( 'gettext', [$this->editor, 'filterPostStatusLabels'], 10, 3 );
47
+		add_filter( 'gettext_with_context', [$this->editor, 'filterPostStatusLabelsWithContext'], 10, 4 );
48
+		add_filter( 'post_updated_messages', [$this->editor, 'filterUpdateMessages'] );
49
+		add_filter( 'bulk_post_updated_messages', [$this->listtable, 'filterBulkUpdateMessages'], 10, 2 );
50
+		add_filter( 'manage_'.Application::POST_TYPE.'_posts_columns', [$this->listtable, 'filterColumnsForPostType'] );
51
+		add_filter( 'default_hidden_columns', [$this->listtable, 'filterDefaultHiddenColumns'], 10, 2 );
52
+		add_filter( 'post_row_actions', [$this->listtable, 'filterRowActions'], 10, 2 );
53 53
 		add_filter( 'manage_edit-'.Application::POST_TYPE.'_sortable_columns', [$this->listtable, 'filterSortableColumns'] );
54
-		add_filter( 'ngettext',                                                [$this->listtable, 'filterStatusText'], 10, 5 );
55
-		add_filter( 'script_loader_tag',                                       [$this->public, 'filterEnqueuedScripts'], 10, 2 );
56
-		add_filter( 'query_vars',                                              [$this->public, 'filterQueryVars'] );
57
-		add_filter( 'gettext',                                                 [$this->translator, 'filterGettext'], 10, 3 );
58
-		add_filter( 'gettext_with_context',                                    [$this->translator, 'filterGettextWithContext'], 10, 4 );
59
-		add_filter( 'ngettext',                                                [$this->translator, 'filterNgettext'], 10, 5 );
60
-		add_filter( 'ngettext_with_context',                                   [$this->translator, 'filterNgettextWithContext'], 10, 6 );
54
+		add_filter( 'ngettext', [$this->listtable, 'filterStatusText'], 10, 5 );
55
+		add_filter( 'script_loader_tag', [$this->public, 'filterEnqueuedScripts'], 10, 2 );
56
+		add_filter( 'query_vars', [$this->public, 'filterQueryVars'] );
57
+		add_filter( 'gettext', [$this->translator, 'filterGettext'], 10, 3 );
58
+		add_filter( 'gettext_with_context', [$this->translator, 'filterGettextWithContext'], 10, 4 );
59
+		add_filter( 'ngettext', [$this->translator, 'filterNgettext'], 10, 5 );
60
+		add_filter( 'ngettext_with_context', [$this->translator, 'filterNgettextWithContext'], 10, 6 );
61 61
 	}
62 62
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
22 22
 	protected $public;
23 23
 	protected $translator;
24 24
 
25
-	public function __construct( Application $app ) {
25
+	public function __construct( Application $app )
26
+	{
26 27
 		$this->app = $app;
27 28
 		$this->admin = $app->make( AdminController::class );
28 29
 		$this->basename = plugin_basename( $app->file );
Please login to merge, or discard this patch.
plugin/Actions.php 2 patches
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -42,48 +42,48 @@
 block discarded – undo
42 42
 	 */
43 43
 	public function run()
44 44
 	{
45
-		add_action( 'admin_enqueue_scripts',                        [$this->admin, 'enqueueAssets'] );
46
-		add_action( 'admin_enqueue_scripts',                        [$this->admin, 'registerPointers'], 13 );
47
-		add_action( 'admin_init',                                   [$this->admin, 'registerShortcodeButtons'] );
48
-		add_action( 'edit_form_after_title',                        [$this->admin, 'renderReviewEditor'] );
49
-		add_action( 'edit_form_top',                                [$this->admin, 'renderReviewNotice'] );
50
-		add_action( 'media_buttons',                                [$this->admin, 'renderTinymceButton'], 11 );
51
-		add_action( 'plugins_loaded',                               [$this->app, 'getDefaults'], 11 );
52
-		add_action( 'plugins_loaded',                               [$this->app, 'registerAddons'] );
53
-		add_action( 'plugins_loaded',                               [$this->app, 'registerLanguages'] );
54
-		add_action( 'plugins_loaded',                               [$this->app, 'registerReviewTypes'] );
55
-		add_action( 'upgrader_process_complete',                    [$this->app, 'upgraded'], 10, 2 );
56
-		add_action( 'admin_enqueue_scripts',                        [$this->editor, 'customizePostStatusLabels'] );
57
-		add_action( 'site-reviews/create/review',                   [$this->editor, 'onCreateReview'], 10, 3 );
58
-		add_action( 'before_delete_post',                           [$this->editor, 'onDeleteReview'] );
59
-		add_action( 'save_post_'.Application::POST_TYPE,            [$this->editor, 'onSaveReview'], 20, 2 );
60
-		add_action( 'add_meta_boxes',                               [$this->editor, 'registerMetaBoxes'] );
61
-		add_action( 'admin_print_scripts',                          [$this->editor, 'removeAutosave'], 999 );
62
-		add_action( 'admin_menu',                                   [$this->editor, 'removeMetaBoxes'] );
63
-		add_action( 'post_submitbox_misc_actions',                  [$this->editor, 'renderPinnedInPublishMetaBox'] );
64
-		add_action( 'admin_action_revert',                          [$this->editor, 'revertReview'] );
65
-		add_action( 'save_post_'.Application::POST_TYPE,            [$this->editor, 'saveMetaboxes'] );
66
-		add_action( 'admin_action_approve',                         [$this->listtable, 'approve'] );
67
-		add_action( 'bulk_edit_custom_box',                         [$this->listtable, 'renderBulkEditFields'], 10, 2 );
68
-		add_action( 'restrict_manage_posts',                        [$this->listtable, 'renderColumnFilters'] );
69
-		add_action( 'manage_posts_custom_column',                   [$this->listtable, 'renderColumnValues'] );
70
-		add_action( 'save_post_'.Application::POST_TYPE,            [$this->listtable, 'saveBulkEditFields'] );
71
-		add_action( 'pre_get_posts',                                [$this->listtable, 'setQueryForColumn'] );
72
-		add_action( 'admin_action_unapprove',                       [$this->listtable, 'unapprove'] );
73
-		add_action( 'init',                                         [$this->main, 'registerPostType'], 8 );
74
-		add_action( 'init',                                         [$this->main, 'registerShortcodes'] );
75
-		add_action( 'init',                                         [$this->main, 'registerTaxonomy'] );
76
-		add_action( 'widgets_init',                                 [$this->main, 'registerWidgets'] );
77
-		add_action( 'wp_footer',                                    [$this->main, 'renderSchema'] );
78
-		add_action( 'admin_menu',                                   [$this->menu, 'registerMenuCount'] );
79
-		add_action( 'admin_menu',                                   [$this->menu, 'registerSubMenus'] );
80
-		add_action( 'admin_init',                                   [$this->menu, 'setCustomPermissions'], 999 );
81
-		add_action( 'wp_enqueue_scripts',                           [$this->public, 'enqueueAssets'], 999 );
82
-		add_action( 'admin_init',                                   [$this->router, 'routeAdminPostRequest'] );
83
-		add_action( 'wp_ajax_'.Application::PREFIX.'action',        [$this->router, 'routeAjaxRequest'] );
45
+		add_action( 'admin_enqueue_scripts', [$this->admin, 'enqueueAssets'] );
46
+		add_action( 'admin_enqueue_scripts', [$this->admin, 'registerPointers'], 13 );
47
+		add_action( 'admin_init', [$this->admin, 'registerShortcodeButtons'] );
48
+		add_action( 'edit_form_after_title', [$this->admin, 'renderReviewEditor'] );
49
+		add_action( 'edit_form_top', [$this->admin, 'renderReviewNotice'] );
50
+		add_action( 'media_buttons', [$this->admin, 'renderTinymceButton'], 11 );
51
+		add_action( 'plugins_loaded', [$this->app, 'getDefaults'], 11 );
52
+		add_action( 'plugins_loaded', [$this->app, 'registerAddons'] );
53
+		add_action( 'plugins_loaded', [$this->app, 'registerLanguages'] );
54
+		add_action( 'plugins_loaded', [$this->app, 'registerReviewTypes'] );
55
+		add_action( 'upgrader_process_complete', [$this->app, 'upgraded'], 10, 2 );
56
+		add_action( 'admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels'] );
57
+		add_action( 'site-reviews/create/review', [$this->editor, 'onCreateReview'], 10, 3 );
58
+		add_action( 'before_delete_post', [$this->editor, 'onDeleteReview'] );
59
+		add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'onSaveReview'], 20, 2 );
60
+		add_action( 'add_meta_boxes', [$this->editor, 'registerMetaBoxes'] );
61
+		add_action( 'admin_print_scripts', [$this->editor, 'removeAutosave'], 999 );
62
+		add_action( 'admin_menu', [$this->editor, 'removeMetaBoxes'] );
63
+		add_action( 'post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox'] );
64
+		add_action( 'admin_action_revert', [$this->editor, 'revertReview'] );
65
+		add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'] );
66
+		add_action( 'admin_action_approve', [$this->listtable, 'approve'] );
67
+		add_action( 'bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2 );
68
+		add_action( 'restrict_manage_posts', [$this->listtable, 'renderColumnFilters'] );
69
+		add_action( 'manage_posts_custom_column', [$this->listtable, 'renderColumnValues'] );
70
+		add_action( 'save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields'] );
71
+		add_action( 'pre_get_posts', [$this->listtable, 'setQueryForColumn'] );
72
+		add_action( 'admin_action_unapprove', [$this->listtable, 'unapprove'] );
73
+		add_action( 'init', [$this->main, 'registerPostType'], 8 );
74
+		add_action( 'init', [$this->main, 'registerShortcodes'] );
75
+		add_action( 'init', [$this->main, 'registerTaxonomy'] );
76
+		add_action( 'widgets_init', [$this->main, 'registerWidgets'] );
77
+		add_action( 'wp_footer', [$this->main, 'renderSchema'] );
78
+		add_action( 'admin_menu', [$this->menu, 'registerMenuCount'] );
79
+		add_action( 'admin_menu', [$this->menu, 'registerSubMenus'] );
80
+		add_action( 'admin_init', [$this->menu, 'setCustomPermissions'], 999 );
81
+		add_action( 'wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999 );
82
+		add_action( 'admin_init', [$this->router, 'routeAdminPostRequest'] );
83
+		add_action( 'wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
84 84
 		add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] );
85
-		add_action( 'init',                                         [$this->router, 'routePublicPostRequest'] );
86
-		add_action( 'admin_init',                                   [$this->router, 'routeWebhookRequest'] );
87
-		add_action( 'admin_init',                                   [$this->settings, 'registerSettings'] );
85
+		add_action( 'init', [$this->router, 'routePublicPostRequest'] );
86
+		add_action( 'admin_init', [$this->router, 'routeWebhookRequest'] );
87
+		add_action( 'admin_init', [$this->settings, 'registerSettings'] );
88 88
 	}
89 89
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
 	protected $router;
26 26
 	protected $settings;
27 27
 
28
-	public function __construct( Application $app ) {
28
+	public function __construct( Application $app )
29
+	{
29 30
 		$this->app = $app;
30 31
 		$this->admin = $app->make( AdminController::class );
31 32
 		$this->editor = $app->make( EditorController::class );
Please login to merge, or discard this patch.
plugin/Modules/Validator/ValidateReview.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function validateRequest( array $request )
57 57
 	{
58
-		if( !$this->isRequestValid( $request )) {
58
+		if( !$this->isRequestValid( $request ) ) {
59 59
 			$this->error = __( 'Please fix the submission errors.', 'site-reviews' );
60 60
 			return $request;
61 61
 		}
62
-		if( empty( $request['title'] )) {
62
+		if( empty($request['title']) ) {
63 63
 			$request['title'] = __( 'No Title', 'site-reviews' );
64 64
 		}
65 65
 		return array_merge( glsr( ValidateReviewDefaults::class )->defaults(), $request );
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 		$rules = array_intersect_key(
74 74
 			apply_filters( 'site-reviews/validation/rules', static::VALIDATION_RULES ),
75 75
 			array_flip( array_merge(
76
-				['rating','terms'],
76
+				['rating', 'terms'],
77 77
 				glsr( OptionManager::class )->get( 'settings.submissions.required', [] )
78
-			))
78
+			) )
79 79
 		);
80
-		$excluded = isset( $request['excluded'] )
80
+		$excluded = isset($request['excluded'])
81 81
 			? json_decode( $request['excluded'] )
82 82
 			: [];
83
-		return array_diff_key( $rules, array_flip( $excluded ));
83
+		return array_diff_key( $rules, array_flip( $excluded ) );
84 84
 	}
85 85
 
86 86
 	/**
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 			return true;
94 94
 		}
95 95
 		$recaptchaResponse = filter_input( INPUT_POST, 'g-recaptcha-response' );
96
-		if( empty( $recaptchaResponse )) {
96
+		if( empty($recaptchaResponse) ) {
97 97
 			return null; //if response is empty we need to return null
98 98
 		}
99 99
 		if( $integration == 'custom' ) {
100 100
 			return $this->isRecaptchaValid( $recaptchaResponse );
101 101
 		}
102 102
 		if( $integration == 'invisible-recaptcha' ) {
103
-			return boolval( apply_filters( 'google_invre_is_valid_request_filter', true ));
103
+			return boolval( apply_filters( 'google_invre_is_valid_request_filter', true ) );
104 104
 		}
105 105
 		return false;
106 106
 	}
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	protected function isRecaptchaValid( $recaptchaResponse )
112 112
 	{
113
-		$endpoint = add_query_arg([
113
+		$endpoint = add_query_arg( [
114 114
 			'remoteip' => glsr( Helper::class )->getIpAddress(),
115 115
 			'response' => $recaptchaResponse,
116 116
 			'secret' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.secret' ),
117 117
 		], 'https://www.google.com/recaptcha/api/siteverify' );
118
-		if( is_wp_error( $response = wp_remote_get( $endpoint ))) {
118
+		if( is_wp_error( $response = wp_remote_get( $endpoint ) ) ) {
119 119
 			glsr_log()->error( $response->get_error_message() );
120 120
 			return false;
121 121
 		}
122
-		$response = json_decode( wp_remote_retrieve_body( $response ));
123
-		if( !empty( $response->success )) {
122
+		$response = json_decode( wp_remote_retrieve_body( $response ) );
123
+		if( !empty($response->success) ) {
124 124
 			return boolval( $response->success );
125 125
 		}
126 126
 		$errorCodes = [
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	{
144 144
 		$rules = $this->getValidationRules( $request );
145 145
 		$errors = glsr( Validator::class )->validate( $request, $rules );
146
-		if( empty( $errors )) {
146
+		if( empty($errors) ) {
147 147
 			return true;
148 148
 		}
149 149
 		$this->setSessionValues( 'errors', $errors );
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	protected function setSessionValues( $type, $value, $loggedMessage = '' )
161 161
 	{
162 162
 		glsr( Session::class )->set( $this->form_id.$type, $value );
163
-		if( !empty( $loggedMessage )) {
163
+		if( !empty($loggedMessage) ) {
164 164
 			glsr_log()->warning( $loggedMessage );
165 165
 			glsr_log()->warning( $this->request );
166 166
 		}
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	protected function validateAkismet()
173 173
 	{
174
-		if( !empty( $this->error ))return;
175
-		if( !glsr( Akismet::class )->isSpam( $this->request ))return;
174
+		if( !empty($this->error) )return;
175
+		if( !glsr( Akismet::class )->isSpam( $this->request ) )return;
176 176
 		$this->setSessionValues( 'errors', [], 'Akismet caught a spam submission:' );
177 177
 		$this->error = __( 'Your review cannot be submitted at this time. Please try again later.', 'site-reviews' );
178 178
 	}
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	protected function validateBlacklist()
184 184
 	{
185
-		if( !empty( $this->error ))return;
186
-		if( !glsr( Blacklist::class )->isBlacklisted( $this->request ))return;
185
+		if( !empty($this->error) )return;
186
+		if( !glsr( Blacklist::class )->isBlacklisted( $this->request ) )return;
187 187
 		$blacklistAction = glsr( OptionManager::class )->get( 'settings.submissions.blacklist.action' );
188 188
 		if( $blacklistAction == 'unapprove' ) {
189 189
 			$this->request['blacklisted'] = true;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	protected function validateCustom()
201 201
 	{
202
-		if( !empty( $this->error ))return;
202
+		if( !empty($this->error) )return;
203 203
 		$validated = apply_filters( 'site-reviews/validate/review/submission', true, $this->request );
204 204
 		if( $validated === true )return;
205 205
 		$this->setSessionValues( 'errors', [] );
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	 */
215 215
 	protected function validateHoneyPot()
216 216
 	{
217
-		if( !empty( $this->error ))return;
218
-		if( empty( $this->request['gotcha'] ))return;
217
+		if( !empty($this->error) )return;
218
+		if( empty($this->request['gotcha']) )return;
219 219
 		$this->setSessionValues( 'errors', [], 'The Honeypot caught a bad submission:' );
220 220
 		$this->error = __( 'The review submission failed. Please notify the site administrator.', 'site-reviews' );
221 221
 	}
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	protected function validateRecaptcha()
227 227
 	{
228
-		if( !empty( $this->error ))return;
228
+		if( !empty($this->error) )return;
229 229
 		$isValid = $this->isRecaptchaResponseValid();
230
-		if( is_null( $isValid )) {
230
+		if( is_null( $isValid ) ) {
231 231
 			$this->setSessionValues( 'recaptcha', true );
232 232
 			$this->recaptchaIsUnset = true;
233 233
 		}
Please login to merge, or discard this patch.
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -171,8 +171,12 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	protected function validateAkismet()
173 173
 	{
174
-		if( !empty( $this->error ))return;
175
-		if( !glsr( Akismet::class )->isSpam( $this->request ))return;
174
+		if( !empty( $this->error )) {
175
+			return;
176
+		}
177
+		if( !glsr( Akismet::class )->isSpam( $this->request )) {
178
+			return;
179
+		}
176 180
 		$this->setSessionValues( 'errors', [], 'Akismet caught a spam submission:' );
177 181
 		$this->error = __( 'Your review cannot be submitted at this time. Please try again later.', 'site-reviews' );
178 182
 	}
@@ -182,8 +186,12 @@  discard block
 block discarded – undo
182 186
 	 */
183 187
 	protected function validateBlacklist()
184 188
 	{
185
-		if( !empty( $this->error ))return;
186
-		if( !glsr( Blacklist::class )->isBlacklisted( $this->request ))return;
189
+		if( !empty( $this->error )) {
190
+			return;
191
+		}
192
+		if( !glsr( Blacklist::class )->isBlacklisted( $this->request )) {
193
+			return;
194
+		}
187 195
 		$blacklistAction = glsr( OptionManager::class )->get( 'settings.submissions.blacklist.action' );
188 196
 		if( $blacklistAction == 'unapprove' ) {
189 197
 			$this->request['blacklisted'] = true;
@@ -199,9 +207,13 @@  discard block
 block discarded – undo
199 207
 	 */
200 208
 	protected function validateCustom()
201 209
 	{
202
-		if( !empty( $this->error ))return;
210
+		if( !empty( $this->error )) {
211
+			return;
212
+		}
203 213
 		$validated = apply_filters( 'site-reviews/validate/review/submission', true, $this->request );
204
-		if( $validated === true )return;
214
+		if( $validated === true ) {
215
+			return;
216
+		}
205 217
 		$this->setSessionValues( 'errors', [] );
206 218
 		$this->setSessionValues( 'values', $this->request );
207 219
 		$this->error = is_string( $validated )
@@ -214,8 +226,12 @@  discard block
 block discarded – undo
214 226
 	 */
215 227
 	protected function validateHoneyPot()
216 228
 	{
217
-		if( !empty( $this->error ))return;
218
-		if( empty( $this->request['gotcha'] ))return;
229
+		if( !empty( $this->error )) {
230
+			return;
231
+		}
232
+		if( empty( $this->request['gotcha'] )) {
233
+			return;
234
+		}
219 235
 		$this->setSessionValues( 'errors', [], 'The Honeypot caught a bad submission:' );
220 236
 		$this->error = __( 'The review submission failed. Please notify the site administrator.', 'site-reviews' );
221 237
 	}
@@ -225,7 +241,9 @@  discard block
 block discarded – undo
225 241
 	 */
226 242
 	protected function validateRecaptcha()
227 243
 	{
228
-		if( !empty( $this->error ))return;
244
+		if( !empty( $this->error )) {
245
+			return;
246
+		}
229 247
 		$isValid = $this->isRecaptchaResponseValid();
230 248
 		if( is_null( $isValid )) {
231 249
 			$this->setSessionValues( 'recaptcha', true );
Please login to merge, or discard this patch.
plugin/Modules/Translator.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$translations = $this->getTranslations();
32 32
 		$entries = $this->filter( $translations, $this->entries() )->results();
33
-		array_walk( $translations, function( &$entry ) use( $entries ) {
33
+		array_walk( $translations, function( &$entry ) use($entries) {
34 34
 			$entry['desc'] = array_key_exists( $entry['id'], $entries )
35 35
 				? $this->getEntryString( $entries[$entry['id']], 'msgctxt' )
36 36
 				: '';
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function entries()
45 45
 	{
46
-		if( !isset( $this->entries )) {
46
+		if( !isset($this->entries) ) {
47 47
 			try {
48 48
 				$potFile = glsr()->path( glsr()->languages.'/'.Application::ID.'.pot' );
49 49
 				$entries = $this->normalize( Parser::parseFile( $potFile )->getEntries() );
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function filter( $filterWith = null, $entries = null, $intersect = true )
78 78
 	{
79
-		if( !is_array( $entries )) {
79
+		if( !is_array( $entries ) ) {
80 80
 			$entries = $this->results;
81 81
 		}
82
-		if( !is_array( $filterWith )) {
82
+		if( !is_array( $filterWith ) ) {
83 83
 			$filterWith = $this->getTranslations();
84 84
 		}
85
-		$keys = array_flip( array_column( $filterWith, 'id' ));
85
+		$keys = array_flip( array_column( $filterWith, 'id' ) );
86 86
 		$this->results = $intersect
87 87
 			? array_intersect_key( $entries, $keys )
88 88
 			: array_diff_key( $entries, $keys );
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		return $this->translate( $translation, $domain, [
101 101
 			'single' => $text,
102
-		]);
102
+		] );
103 103
 	}
104 104
 
105 105
 	/**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		return $this->translate( $translation, $domain, [
115 115
 			'context' => $context,
116 116
 			'single' => $text,
117
-		]);
117
+		] );
118 118
 	}
119 119
 
120 120
 	/**
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 			'number' => $number,
132 132
 			'plural' => $plural,
133 133
 			'single' => $single,
134
-		]);
134
+		] );
135 135
 	}
136 136
 
137 137
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			'number' => $number,
151 151
 			'plural' => $plural,
152 152
 			'single' => $single,
153
-		]);
153
+		] );
154 154
 	}
155 155
 
156 156
 	/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	public function render( $template, array $entry )
161 161
 	{
162 162
 		$data = array_combine(
163
-			array_map( function( $key ) { return 'data.'.$key; }, array_keys( $entry )),
163
+			array_map( function( $key ) { return 'data.'.$key; }, array_keys( $entry ) ),
164 164
 			$entry
165 165
 		);
166 166
 		ob_start();
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 				'p1' => $this->getEntryString( $entry, 'msgid_plural' ),
198 198
 				's1' => $this->getEntryString( $entry, 'msgid' ),
199 199
 			];
200
-			$text = !empty( $data['p1'] )
200
+			$text = !empty($data['p1'])
201 201
 				? sprintf( '%s | %s', $data['s1'], $data['p1'] )
202 202
 				: $data['s1'];
203 203
 			$rendered .= $this->render( 'result', [
204 204
 				'entry' => wp_json_encode( $data ),
205 205
 				'text' => wp_strip_all_tags( $text ),
206
-			]);
206
+			] );
207 207
 		}
208 208
 		if( $resetAfterRender ) {
209 209
 			$this->reset();
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 	public function search( $needle = '' )
237 237
 	{
238 238
 		$this->reset();
239
-		$needle = trim( strtolower( $needle ));
239
+		$needle = trim( strtolower( $needle ) );
240 240
 		foreach( $this->entries() as $key => $entry ) {
241
-			$single = strtolower( $this->getEntryString( $entry, 'msgid' ));
242
-			$plural = strtolower( $this->getEntryString( $entry, 'msgid_plural' ));
241
+			$single = strtolower( $this->getEntryString( $entry, 'msgid' ) );
242
+			$plural = strtolower( $this->getEntryString( $entry, 'msgid_plural' ) );
243 243
 			if( strlen( $needle ) < static::SEARCH_THRESHOLD ) {
244
-				if( in_array( $needle, [$single, $plural] )) {
244
+				if( in_array( $needle, [$single, $plural] ) ) {
245 245
 					$this->results[$key] = $entry;
246 246
 				}
247 247
 			}
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		}
265 265
 		$args = $this->normalizeTranslationArgs( $args );
266 266
 		$strings = $this->getTranslationStrings( $args['single'], $args['plural'] );
267
-		if( empty( $strings )) {
267
+		if( empty($strings) ) {
268 268
 			return $original;
269 269
 		}
270 270
 		$string = current( $strings );
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	protected function getEntryString( array $entry, $key )
281 281
 	{
282
-		return isset( $entry[$key] )
283
-			? implode( '', (array) $entry[$key] )
282
+		return isset($entry[$key])
283
+			? implode( '', (array)$entry[$key] )
284 284
 			: '';
285 285
 	}
286 286
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
 	protected function getTranslations()
291 291
 	{
292 292
 		$settings = glsr( OptionManager::class )->get( 'settings' );
293
-		return isset( $settings['translations'] )
294
-			? $this->normalizeSettings( (array) $settings['translations'] )
293
+		return isset($settings['translations'])
294
+			? $this->normalizeSettings( (array)$settings['translations'] )
295 295
 			: [];
296 296
 	}
297 297
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	protected function getTranslationStrings( $single, $plural )
304 304
 	{
305
-		return array_filter( $this->getTranslations(), function( $string ) use( $single, $plural ) {
305
+		return array_filter( $this->getTranslations(), function( $string ) use($single, $plural) {
306 306
 			return $string['s1'] == html_entity_decode( $single, ENT_COMPAT, 'UTF-8' )
307 307
 				&& $string['p1'] == html_entity_decode( $plural, ENT_COMPAT, 'UTF-8' );
308 308
 		});
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$keys = [
317 317
 			'msgctxt', 'msgid', 'msgid_plural', 'msgstr', 'msgstr[0]', 'msgstr[1]',
318 318
 		];
319
-		array_walk( $entries, function( &$entry ) use( $keys ) {
319
+		array_walk( $entries, function( &$entry ) use($keys) {
320 320
 			foreach( $keys as $key ) {
321 321
 				$entry = $this->normalizeEntryString( $entry, $key );
322 322
 			}
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 */
331 331
 	protected function normalizeEntryString( array $entry, $key )
332 332
 	{
333
-		if( isset( $entry[$key] )) {
333
+		if( isset($entry[$key]) ) {
334 334
 			$entry[$key] = $this->getEntryString( $entry, $key );
335 335
 		}
336 336
 		return $entry;
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
 		$defaultString = array_fill_keys( ['id', 's1', 's2', 'p1', 'p2'], '' );
345 345
 		$strings = array_filter( $strings, 'is_array' );
346 346
 		foreach( $strings as &$string ) {
347
-			$string['type'] = isset( $string['p1'] ) ? 'plural' : 'single';
347
+			$string['type'] = isset($string['p1']) ? 'plural' : 'single';
348 348
 			$string = wp_parse_args( $string, $defaultString );
349 349
 		}
350 350
 		return array_filter( $strings, function( $string ) {
351
-			return !empty( $string['id'] );
351
+			return !empty($string['id']);
352 352
 		});
353 353
 	}
354 354
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 */
373 373
 	protected function translatePlural( $domain, array $string, array $args )
374 374
 	{
375
-		if( !empty( $string['p2'] )) {
375
+		if( !empty($string['p2']) ) {
376 376
 			$args['plural'] = $string['p2'];
377 377
 		}
378 378
 		return get_translations_for_domain( $domain )->translate_plural(
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 	 */
390 390
 	protected function translateSingle( $domain, array $string, array $args )
391 391
 	{
392
-		if( !empty( $string['s2'] )) {
392
+		if( !empty($string['s2']) ) {
393 393
 			$args['single'] = $string['s2'];
394 394
 		}
395 395
 		return get_translations_for_domain( $domain )->translate(
Please login to merge, or discard this patch.
views/pages/addons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 				'name' => 'tripadvisor',
13 13
 				'title' => 'Tripadvisor Reviews',
14 14
 			],
15
-		]);
15
+		] );
16 16
 		$template->render( 'addons/addon', [
17 17
 			'context' => [
18 18
 				'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ),
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				'name' => 'yelp',
21 21
 				'title' => 'Yelp Reviews',
22 22
 			],
23
-		]);
23
+		] );
24 24
 	?>
25 25
 	</div>
26 26
 </div>
Please login to merge, or discard this patch.
plugin/Modules/Html/Template.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@
 block discarded – undo
63 63
 	{
64 64
 		$data = wp_parse_args( $data, array_fill_keys( ['context', 'globals'], [] ));
65 65
 		foreach( $data as $key => $value ) {
66
-			if( is_array( $value ))continue;
66
+			if( is_array( $value )) {
67
+				continue;
68
+			}
67 69
 			$data[$key] = [];
68 70
 		}
69 71
 		$data['template'] = $this;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function renderSettingFields( $id )
57 57
 	{
58
-		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ));
58
+		$fields = $this->getSettingFields( $this->normalizeSettingPath( $id ) );
59 59
 		$rows = '';
60 60
 		foreach( $fields as $name => $field ) {
61 61
 			$field = wp_parse_args( $field, [
62 62
 				'name' => $name,
63 63
 				'table' => true,
64
-			]);
65
-			$rows.= (new Field( $field ))->build();
64
+			] );
65
+			$rows .= (new Field( $field ))->build();
66 66
 		}
67 67
 		$this->render( 'pages/settings/'.$id, [
68 68
 			'context' => [
69 69
 				'rows' => $rows,
70 70
 			],
71
-		]);
71
+		] );
72 72
 	}
73 73
 
74 74
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	protected function getSettingFields( $path )
78 78
 	{
79 79
 		$settings = glsr( DefaultsManager::class )->settings();
80
-		return array_filter( $settings, function( $key ) use( $path ) {
80
+		return array_filter( $settings, function( $key ) use($path) {
81 81
 			return glsr( Helper::class )->startsWith( $path, $key );
82 82
 		}, ARRAY_FILTER_USE_KEY );
83 83
 	}
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	protected function normalize( array $data )
89 89
 	{
90
-		$data = wp_parse_args( $data, array_fill_keys( ['context', 'globals'], [] ));
90
+		$data = wp_parse_args( $data, array_fill_keys( ['context', 'globals'], [] ) );
91 91
 		foreach( $data as $key => $value ) {
92
-			if( is_array( $value ))continue;
92
+			if( is_array( $value ) )continue;
93 93
 			$data[$key] = [];
94 94
 		}
95 95
 		$data['template'] = $this;
Please login to merge, or discard this patch.
plugin/Modules/Html/Form.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	public function build( $path, array $fields = [] )
17 17
 	{
18
-		if( empty( $fields )) {
19
-			$fields = $this->getSettingsFields( $this->normalizeSettingsPath( $path ));
18
+		if( empty($fields) ) {
19
+			$fields = $this->getSettingsFields( $this->normalizeSettingsPath( $path ) );
20 20
 		}
21 21
 		foreach( $fields as $name => &$field ) {
22 22
 			$field = wp_parse_args( $field, ['name' => $name] );
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	protected function getSettingsFields( $path )
34 34
 	{
35 35
 		$settings = glsr( DefaultsManager::class )->settings();
36
-		return array_filter( $settings, function( $key ) use( $path ) {
36
+		return array_filter( $settings, function( $key ) use($path) {
37 37
 			return glsr( Helper::class )->startsWith( $path, $key );
38 38
 		}, ARRAY_FILTER_USE_KEY );
39 39
 	}
Please login to merge, or discard this patch.
plugin/Controllers/EditorController.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -147,13 +147,13 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	public function renderAssignedToMetabox( WP_Post $post )
149 149
 	{
150
-		if( !$this->isReviewPostType( $post ))return;
151
-		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ));
150
+		if( !$this->isReviewPostType( $post ) )return;
151
+		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ) );
152 152
 		wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false );
153 153
 		glsr()->render( 'editor/metabox-assigned-to', [
154 154
 			'id' => $assignedTo,
155 155
 			'template' => $this->buildAssignedToTemplate( $assignedTo ),
156
-		]);
156
+		] );
157 157
 	}
158 158
 
159 159
 	/**
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 	 */
163 163
 	public function renderDetailsMetaBox( WP_Post $post )
164 164
 	{
165
-		if( !$this->isReviewPostType( $post ))return;
165
+		if( !$this->isReviewPostType( $post ) )return;
166 166
 		$review = glsr( Database::class )->getReview( $post );
167 167
 		glsr()->render( 'editor/metabox-details', [
168 168
 			'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ),
169 169
 			'metabox' => $this->normalizeDetailsMetaBox( $review ),
170
-		]);
170
+		] );
171 171
 	}
172 172
 
173 173
 	/**
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public function renderPinnedInPublishMetaBox()
178 178
 	{
179
-		if( !$this->isReviewPostType( get_post() ))return;
179
+		if( !$this->isReviewPostType( get_post() ) )return;
180 180
 		glsr()->render( 'editor/pinned', [
181
-			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )),
182
-		]);
181
+			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true ) ),
182
+		] );
183 183
 	}
184 184
 
185 185
 	/**
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public function renderResponseMetaBox( WP_Post $post )
190 190
 	{
191
-		if( !$this->isReviewPostType( $post ))return;
191
+		if( !$this->isReviewPostType( $post ) )return;
192 192
 		wp_nonce_field( 'response', '_nonce-response', false );
193 193
 		glsr()->render( 'editor/metabox-response', [
194 194
 			'response' => glsr( Database::class )->getReview( $post )->response,
195
-		]);
195
+		] );
196 196
 	}
197 197
 
198 198
 	/**
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public function renderTaxonomyMetabox( WP_Post $post )
204 204
 	{
205
-		if( !$this->isReviewPostType( $post ))return;
205
+		if( !$this->isReviewPostType( $post ) )return;
206 206
 		glsr()->render( 'editor/metabox-categories', [
207 207
 			'post' => $post,
208 208
 			'tax_name' => Application::TAXONOMY,
209 209
 			'taxonomy' => get_taxonomy( Application::TAXONOMY ),
210
-		]);
210
+		] );
211 211
 	}
212 212
 
213 213
 	/**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 */
218 218
 	public function revertReview()
219 219
 	{
220
-		check_admin_referer( 'revert-review_'.( $postId = $this->getPostId() ));
220
+		check_admin_referer( 'revert-review_'.($postId = $this->getPostId()) );
221 221
 		glsr( Database::class )->revertReview( $postId );
222 222
 		$this->redirect( $postId, 52 );
223 223
 	}
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
 	protected function buildAssignedToTemplate( $assignedTo )
241 241
 	{
242 242
 		$assignedPost = get_post( $assignedTo );
243
-		if( !( $assignedPost instanceof WP_Post ))return;
243
+		if( !($assignedPost instanceof WP_Post) )return;
244 244
 		return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [
245 245
 			'context' => [
246 246
 				'url' => (string)get_permalink( $assignedPost ),
247 247
 				'title' => get_the_title( $assignedPost ),
248 248
 			],
249
-		]);
249
+		] );
250 250
 	}
251 251
 
252 252
 	/**
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 				'class' => 'button button-large',
268 268
 				'href' => $revertUrl,
269 269
 				'id' => 'revert',
270
-			]);
270
+			] );
271 271
 		}
272 272
 		return glsr( Builder::class )->button( __( 'Nothing to Revert', 'site-reviews' ), [
273 273
 			'class' => 'button button-large',
274 274
 			'disabled' => true,
275 275
 			'id' => 'revert',
276
-		]);
276
+		] );
277 277
 	}
278 278
 
279 279
 	/**
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 	protected function getReviewType( $review )
284 284
 	{
285 285
 		$reviewType = $review->review_type;
286
-		if( !empty( $review->url )) {
286
+		if( !empty($review->url) ) {
287 287
 			$reviewType = glsr( Builder::class )->a( $reviewType, [
288 288
 				'href' => $review->url,
289 289
 				'target' => '_blank',
290
-			]);
290
+			] );
291 291
 		}
292 292
 		return in_array( $reviewType, glsr()->reviewTypes )
293 293
 			? glsr()->reviewTypes[$reviewType]
@@ -309,16 +309,16 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	protected function normalizeDetailsMetaBox( $review )
311 311
 	{
312
-		$reviewer = empty( $review->user_id )
312
+		$reviewer = empty($review->user_id)
313 313
 			? __( 'Unregistered user', 'site-reviews' )
314 314
 			: glsr( Builder::class )->a( get_the_author_meta( 'display_name', $review->user_id ), [
315 315
 				'href' => get_author_posts_url( $review->user_id ),
316
-			]);
317
-		$email = empty( $review->email )
316
+			] );
317
+		$email = empty($review->email)
318 318
 			? '&mdash;'
319 319
 			: glsr( Builder::class )->a( $review->email, [
320 320
 				'href' => 'mailto:'.$review->email.'?subject='.esc_attr( __( 'RE:', 'site-reviews' ).' '.$review->title ),
321
-			]);
321
+			] );
322 322
 		$metabox = [
323 323
 			__( 'Rating', 'site-reviews' ) => glsr( Html::class )->renderPartial( 'star-rating', ['rating' => $review->rating] ),
324 324
 			__( 'Type', 'site-reviews' ) => $this->getReviewType( $review ),
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		$redirectUri = $hasReferer
347 347
 			? remove_query_arg( ['deleted', 'ids', 'trashed', 'untrashed'], $referer )
348 348
 			: get_edit_post_link( $postId );
349
-		wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri ));
349
+		wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri ) );
350 350
 		exit;
351 351
 	}
352 352
 }
Please login to merge, or discard this patch.
Braces   +21 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,9 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function registerMetaBoxes( $postType )
119 119
 	{
120
-		if( $postType != Application::POST_TYPE )return;
120
+		if( $postType != Application::POST_TYPE ) {
121
+			return;
122
+		}
121 123
 		add_meta_box( Application::ID.'_assigned_to', __( 'Assigned To', 'site-reviews' ), [$this, 'renderAssignedToMetabox'], null, 'side' );
122 124
 		add_meta_box( Application::ID.'_review', __( 'Details', 'site-reviews' ), [$this, 'renderDetailsMetaBox'], null, 'side' );
123 125
 		add_meta_box( Application::ID.'_response', __( 'Respond Publicly', 'site-reviews' ), [$this, 'renderResponseMetaBox'], null, 'normal' );
@@ -147,7 +149,9 @@  discard block
 block discarded – undo
147 149
 	 */
148 150
 	public function renderAssignedToMetabox( WP_Post $post )
149 151
 	{
150
-		if( !$this->isReviewPostType( $post ))return;
152
+		if( !$this->isReviewPostType( $post )) {
153
+			return;
154
+		}
151 155
 		$assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ));
152 156
 		wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false );
153 157
 		glsr()->render( 'editor/metabox-assigned-to', [
@@ -162,7 +166,9 @@  discard block
 block discarded – undo
162 166
 	 */
163 167
 	public function renderDetailsMetaBox( WP_Post $post )
164 168
 	{
165
-		if( !$this->isReviewPostType( $post ))return;
169
+		if( !$this->isReviewPostType( $post )) {
170
+			return;
171
+		}
166 172
 		$review = glsr( Database::class )->getReview( $post );
167 173
 		glsr()->render( 'editor/metabox-details', [
168 174
 			'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ),
@@ -176,7 +182,9 @@  discard block
 block discarded – undo
176 182
 	 */
177 183
 	public function renderPinnedInPublishMetaBox()
178 184
 	{
179
-		if( !$this->isReviewPostType( get_post() ))return;
185
+		if( !$this->isReviewPostType( get_post() )) {
186
+			return;
187
+		}
180 188
 		glsr()->render( 'editor/pinned', [
181 189
 			'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )),
182 190
 		]);
@@ -188,7 +196,9 @@  discard block
 block discarded – undo
188 196
 	 */
189 197
 	public function renderResponseMetaBox( WP_Post $post )
190 198
 	{
191
-		if( !$this->isReviewPostType( $post ))return;
199
+		if( !$this->isReviewPostType( $post )) {
200
+			return;
201
+		}
192 202
 		wp_nonce_field( 'response', '_nonce-response', false );
193 203
 		glsr()->render( 'editor/metabox-response', [
194 204
 			'response' => glsr( Database::class )->getReview( $post )->response,
@@ -202,7 +212,9 @@  discard block
 block discarded – undo
202 212
 	 */
203 213
 	public function renderTaxonomyMetabox( WP_Post $post )
204 214
 	{
205
-		if( !$this->isReviewPostType( $post ))return;
215
+		if( !$this->isReviewPostType( $post )) {
216
+			return;
217
+		}
206 218
 		glsr()->render( 'editor/metabox-categories', [
207 219
 			'post' => $post,
208 220
 			'tax_name' => Application::TAXONOMY,
@@ -240,7 +252,9 @@  discard block
 block discarded – undo
240 252
 	protected function buildAssignedToTemplate( $assignedTo )
241 253
 	{
242 254
 		$assignedPost = get_post( $assignedTo );
243
-		if( !( $assignedPost instanceof WP_Post ))return;
255
+		if( !( $assignedPost instanceof WP_Post )) {
256
+			return;
257
+		}
244 258
 		return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [
245 259
 			'context' => [
246 260
 				'url' => (string)get_permalink( $assignedPost ),
Please login to merge, or discard this patch.