Passed
Push — master ( ee0da0...af44f0 )
by Paul
04:33
created
plugin/Handlers/RegisterShortcodeButtons.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 	{
15 15
 		foreach( $command->shortcodes as $slug => $label ) {
16 16
 			$buttonClass = glsr( Helper::class )->buildClassName( $slug.'-button', 'Shortcodes' );
17
-			if( !class_exists( $buttonClass )) {
18
-				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ));
17
+			if( !class_exists( $buttonClass ) ) {
18
+				glsr_log()->error( sprintf( 'Class missing (%s)', $buttonClass ) );
19 19
 				continue;
20 20
 			}
21 21
 			$shortcode = glsr( $buttonClass )->register( $slug, [
22 22
 				'label' => $label,
23 23
 				'title' => $label,
24
-			]);
24
+			] );
25 25
 			glsr()->mceShortcodes[$slug] = $shortcode->properties;
26 26
 		}
27 27
 	}
Please login to merge, or discard this patch.
plugin/Handlers/RegisterShortcodes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 	{
15 15
 		foreach( $command->shortcodes as $shortcode ) {
16 16
 			$shortcodeClass = glsr( Helper::class )->buildClassName( $shortcode.'-shortcode', 'Shortcodes' );
17
-			if( !class_exists( $shortcodeClass )) {
18
-				glsr_log()->error( sprintf( 'Class missing (%s)', $shortcodeClass ));
17
+			if( !class_exists( $shortcodeClass ) ) {
18
+				glsr_log()->error( sprintf( 'Class missing (%s)', $shortcodeClass ) );
19 19
 				continue;
20 20
 			}
21 21
 			add_shortcode( $shortcode, [glsr( $shortcodeClass ), 'buildShortcode'] );
Please login to merge, or discard this patch.
plugin/Handlers/RegisterWidgets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 		global $wp_widget_factory;
17 17
 		foreach( $command->widgets as $key => $values ) {
18 18
 			$widgetClass = glsr( Helper::class )->buildClassName( $key.'-widget', 'Widgets' );
19
-			if( !class_exists( $widgetClass )) {
20
-				glsr_log()->error( sprintf( 'Class missing (%s)', $widgetClass ));
19
+			if( !class_exists( $widgetClass ) ) {
20
+				glsr_log()->error( sprintf( 'Class missing (%s)', $widgetClass ) );
21 21
 				continue;
22 22
 			}
23 23
 			// Here we bypass register_widget() in order to pass our custom values to the widget
Please login to merge, or discard this patch.
plugin/Handlers/TogglePinned.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 	 */
13 13
 	public function handle( Command $command )
14 14
 	{
15
-		if( !get_post( $command->id )) {
15
+		if( !get_post( $command->id ) ) {
16 16
 			return false;
17 17
 		}
18
-		if( is_null( $command->pinned )) {
18
+		if( is_null( $command->pinned ) ) {
19 19
 			$meta = get_post_meta( $command->id, 'pinned', true );
20 20
 			$command->pinned = !wp_validate_boolean( $meta );
21 21
 		}
Please login to merge, or discard this patch.
plugin/Filters.php 2 patches
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.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@
 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 );
54
+		add_filter( 'ngettext', [$this->listtable, 'filterStatusText'], 10, 5 );
55 55
 		// add_filter( 'script_loader_tag',                                       [$this->public, 'filterEnqueuedScripts'], 10, 2 );
56 56
 		// add_filter( 'query_vars',                                              [$this->public, 'filterQueryVars'] );
57 57
 		// add_filter( 'gettext',                                                 [$this->translator, 'filterGettext'], 10, 3 );
Please login to merge, or discard this patch.
plugin/Controllers/Controller.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	public function download( $filename, $content )
17 17
 	{
18
-		if( !current_user_can( Application::CAPABILITY ))return;
18
+		if( !current_user_can( Application::CAPABILITY ) )return;
19 19
 		nocache_headers();
20 20
 		header( 'Content-Type: text/plain' );
21 21
 		header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
22
-		echo html_entity_decode( wp_strip_all_tags( $content ));
22
+		echo html_entity_decode( wp_strip_all_tags( $content ) );
23 23
 		exit;
24 24
 	}
25 25
 
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function execute( $command )
32 32
 	{
33
-		$handlerClass = str_replace( 'Commands', 'Handlers', get_class( $command ));
34
-		if( !class_exists( $handlerClass )) {
33
+		$handlerClass = str_replace( 'Commands', 'Handlers', get_class( $command ) );
34
+		if( !class_exists( $handlerClass ) ) {
35 35
 			throw new InvalidArgumentException( 'Handler '.$handlerClass.' not found.' );
36 36
 		}
37 37
 		try {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		}
40 40
 		catch( Exception $e ) {
41 41
 			status_header( 400 );
42
-			glsr( Notice::class )->addError( new WP_Error( 'site_reviews_error', $e->getMessage() ));
42
+			glsr( Notice::class )->addError( new WP_Error( 'site_reviews_error', $e->getMessage() ) );
43 43
 			glsr_log()->error( $e->getMessage() );
44 44
 		}
45 45
 	}
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	protected function getPostId()
51 51
 	{
52
-		return intval( filter_input( INPUT_GET, 'post' ));
52
+		return intval( filter_input( INPUT_GET, 'post' ) );
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@
 block discarded – undo
15 15
 	 */
16 16
 	public function download( $filename, $content )
17 17
 	{
18
-		if( !current_user_can( Application::CAPABILITY ))return;
18
+		if( !current_user_can( Application::CAPABILITY )) {
19
+			return;
20
+		}
19 21
 		nocache_headers();
20 22
 		header( 'Content-Type: text/plain' );
21 23
 		header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
Please login to merge, or discard this patch.
plugin/Modules/Html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 	{
83 83
 		$this->render()->div( glsr( Notice::class )->get(), [
84 84
 			'id' => 'glsr-notices',
85
-		]);
85
+		] );
86 86
 	}
87 87
 
88 88
 	/**
Please login to merge, or discard this patch.
plugin/Modules/Validator/ValidationRules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,8 +130,8 @@
 block discarded – undo
130 130
 	public function validateRequired( $attribute, $value )
131 131
 	{
132 132
 		return is_null( $value )
133
-			|| ( is_string( $value ) && trim( $value ) === '' )
134
-			|| ( is_array( $value ) && count( $value ) < 1 )
133
+			|| (is_string( $value ) && trim( $value ) === '')
134
+			|| (is_array( $value ) && count( $value ) < 1)
135 135
 			? false
136 136
 			: true;
137 137
 	}
Please login to merge, or discard this patch.
plugin/Modules/Email.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$this->message = $this->buildHtmlMessage( $email );
44 44
 		$this->subject = $email['subject'];
45 45
 		$this->to = $email['to'];
46
-		add_action( 'phpmailer_init', [ $this, 'buildPlainTextMessage'] );
46
+		add_action( 'phpmailer_init', [$this, 'buildPlainTextMessage'] );
47 47
 		return $this;
48 48
 	}
49 49
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function buildPlainTextMessage( $phpmailer )
85 85
 	{
86
-		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return;
86
+		if( $phpmailer->ContentType === 'text/plain' || !empty($phpmailer->AltBody) )return;
87 87
 		$message = $this->stripHtmlTags( $phpmailer->Body );
88 88
 		$phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this );
89 89
 	}
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 			'from',
100 100
 			'reply-to',
101 101
 		];
102
-		$headers = array_intersect_key( $email, array_flip( $allowed ));
102
+		$headers = array_intersect_key( $email, array_flip( $allowed ) );
103 103
 		$headers = array_filter( $headers );
104 104
 		foreach( $headers as $key => $value ) {
105
-			unset( $headers[ $key ] );
105
+			unset($headers[$key]);
106 106
 			$headers[] = "{$key}: {$value}";
107 107
 		}
108 108
 		$headers[] = 'Content-Type: text/html';
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	protected function buildHtmlMessage( $email )
116 116
 	{
117
-		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ));
118
-		if( !empty( $template )) {
117
+		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ) );
118
+		if( !empty($template) ) {
119 119
 			$message = glsr( Template::class )->interpolate( $template, $email['template-tags'] );
120 120
 		}
121 121
 		else if( $email['template'] ) {
122 122
 			$message = glsr( Template::class )->build( 'templates/'.$email['template'], [
123 123
 				'context' => $email['template-tags'],
124
-			]);
124
+			] );
125 125
 		}
126
-		if( !isset( $message )) {
126
+		if( !isset($message) ) {
127 127
 			$message = $email['message'];
128 128
 		}
129 129
 		$message = $email['before'].$message.$email['after'];
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$message = str_replace( ']]>', ']]&gt;', $message );
135 135
 		$message = glsr( Template::class )->build( 'email/index', [
136 136
 			'context' => ['message' => $message],
137
-		]);
137
+		] );
138 138
 		return apply_filters( 'site-reviews/email/message', stripslashes( $message ), 'html', $this );
139 139
 	}
140 140
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'to' => '',
161 161
 		];
162 162
 		$email = shortcode_atts( $defaults, $email );
163
-		if( empty( $email['reply-to'] )) {
163
+		if( empty($email['reply-to']) ) {
164 164
 			$email['reply-to'] = $email['from'];
165 165
 		}
166 166
 		return apply_filters( 'site-reviews/email/compose', $email, $this );
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,9 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function send()
66 66
 	{
67
-		if( !$this->message || !$this->subject || !$this->to )return;
67
+		if( !$this->message || !$this->subject || !$this->to ) {
68
+			return;
69
+		}
68 70
 		$sent = wp_mail(
69 71
 			$this->to,
70 72
 			$this->subject,
@@ -83,7 +85,9 @@  discard block
 block discarded – undo
83 85
 	 */
84 86
 	public function buildPlainTextMessage( $phpmailer )
85 87
 	{
86
-		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return;
88
+		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) {
89
+			return;
90
+		}
87 91
 		$message = $this->stripHtmlTags( $phpmailer->Body );
88 92
 		$phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this );
89 93
 	}
Please login to merge, or discard this patch.