Passed
Push — master ( 7de9ff...9a7a6b )
by Paul
07:10 queued 03:33
created
plugin/Database/OptionManager.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 		$options = $this->all();
43 43
 		$pointer = &$options;
44 44
 		foreach( $keys as $key ) {
45
-			if( !isset( $pointer[$key] ) || !is_array( $pointer[$key] ))continue;
45
+			if( !isset( $pointer[$key] ) || !is_array( $pointer[$key] )) {
46
+				continue;
47
+			}
46 48
 			$pointer = &$pointer[$key];
47 49
 		}
48 50
 		unset( $pointer[$last] );
@@ -77,7 +79,9 @@  discard block
 block discarded – undo
77 79
 			glsr( DefaultsManager::class )->defaults()
78 80
 		);
79 81
 		array_walk( $options, function( &$value ) {
80
-			if( !is_string( $value ))return;
82
+			if( !is_string( $value )) {
83
+				return;
84
+			}
81 85
 			$value = wp_kses( $value, wp_kses_allowed_html( 'post' ));
82 86
 		});
83 87
 		return glsr( Helper::class )->convertDotNotationArray( $options );
Please login to merge, or discard this patch.
plugin/Modules/Html/Template.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,9 @@
 block discarded – undo
53 53
 		$arrayKeys = ['context', 'globals'];
54 54
 		$data = wp_parse_args( $data, array_fill_keys( $arrayKeys, [] ));
55 55
 		foreach( $arrayKeys as $key ) {
56
-			if( is_array( $data[$key] ))continue;
56
+			if( is_array( $data[$key] )) {
57
+				continue;
58
+			}
57 59
 			$data[$key] = [];
58 60
 		}
59 61
 		return $data;
Please login to merge, or discard this patch.
plugin/Handlers/EnqueueAdminAssets.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,9 @@  discard block
 block discarded – undo
36 36
 			[],
37 37
 			glsr()->version
38 38
 		);
39
-		if( !$this->isCurrentScreen() )return;
39
+		if( !$this->isCurrentScreen() ) {
40
+			return;
41
+		}
40 42
 		wp_enqueue_script(
41 43
 			Application::ID,
42 44
 			glsr()->url( 'assets/scripts/'.Application::ID.'-admin.js' ),
@@ -113,8 +115,12 @@  discard block
 block discarded – undo
113 115
 		$dismissedPointers = explode( ',', (string)$dismissedPointers );
114 116
 		$generatedPointers = [];
115 117
 		foreach( $pointers as $pointer ) {
116
-			if( $pointer['screen'] != glsr_current_screen()->id )continue;
117
-			if( in_array( $pointer['id'], $dismissedPointers ))continue;
118
+			if( $pointer['screen'] != glsr_current_screen()->id ) {
119
+				continue;
120
+			}
121
+			if( in_array( $pointer['id'], $dismissedPointers )) {
122
+				continue;
123
+			}
118 124
 			$generatedPointers[] = $this->generatePointer( $pointer );
119 125
 		}
120 126
 		$this->pointers = $generatedPointers;
@@ -140,7 +146,9 @@  discard block
 block discarded – undo
140 146
 	{
141 147
 		$variables = [];
142 148
 		foreach( glsr()->mceShortcodes as $tag => $args ) {
143
-			if( empty( $args['required'] ))continue;
149
+			if( empty( $args['required'] )) {
150
+				continue;
151
+			}
144 152
 			$variables[$tag] = $args['required'];
145 153
 		}
146 154
 		return $variables;
Please login to merge, or discard this patch.
autoload.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,13 @@
 block discarded – undo
15 15
 	];
16 16
 	foreach( $namespaces as $prefix => $baseDir ) {
17 17
 		$len = strlen( $prefix );
18
-		if( strncmp( $prefix, $className, $len ) !== 0 )continue;
18
+		if( strncmp( $prefix, $className, $len ) !== 0 ) {
19
+			continue;
20
+		}
19 21
 		$file = $baseDir.str_replace( '\\', '/', substr( $className, $len )).'.php';
20
-		if( !file_exists( $file ))continue;
22
+		if( !file_exists( $file )) {
23
+			continue;
24
+		}
21 25
 		require $file;
22 26
 		break;
23 27
 	}
Please login to merge, or discard this patch.
plugin/Controllers/PublicController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@
 block discarded – undo
50 50
 	public function routerSubmitReview( array $request )
51 51
 	{
52 52
 		$validated = glsr( ValidateReview::class )->validate( $request );
53
-		if( !empty( $validated->error ) || $validated->recaptchaIsUnset )return;
53
+		if( !empty( $validated->error ) || $validated->recaptchaIsUnset ) {
54
+			return;
55
+		}
54 56
 		$this->execute( new CreateReview( $validated->request ));
55 57
 	}
56 58
 }
Please login to merge, or discard this patch.
plugin/Modules/Html/Field.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function build()
45 45
 	{
46
-		if( !$this->field['is_valid'] )return;
46
+		if( !$this->field['is_valid'] ) {
47
+			return;
48
+		}
47 49
 		if( $this->field['is_raw'] ) {
48 50
 			return glsr( Builder::class )->{$this->field['type']}( $this->field );
49 51
 		}
@@ -143,7 +145,9 @@  discard block
 block discarded – undo
143 145
 	 */
144 146
 	protected function getFieldErrors()
145 147
 	{
146
-		if( empty( $this->field['errors'] ) || !is_array( $this->field['errors'] ))return;
148
+		if( empty( $this->field['errors'] ) || !is_array( $this->field['errors'] )) {
149
+			return;
150
+		}
147 151
 		$errors = array_reduce( $this->field['errors'], function( $carry, $error ) {
148 152
 			return $carry.glsr( Builder::class )->span( $error, ['class' => 'glsr-field-error'] );
149 153
 		});
@@ -170,7 +174,9 @@  discard block
 block discarded – undo
170 174
 			'name', 'type',
171 175
 		];
172 176
 		foreach( $requiredValues as $value ) {
173
-			if( isset( $this->field[$value] ))continue;
177
+			if( isset( $this->field[$value] )) {
178
+				continue;
179
+			}
174 180
 			$missingValues[] = $value;
175 181
 			$this->field['is_valid'] = false;
176 182
 		}
@@ -187,7 +193,9 @@  discard block
 block discarded – undo
187 193
 	 */
188 194
 	protected function normalize()
189 195
 	{
190
-		if( !$this->isFieldValid() )return;
196
+		if( !$this->isFieldValid() ) {
197
+			return;
198
+		}
191 199
 		$this->field['path'] = $this->field['name'];
192 200
 		$className = glsr( Helper::class )->buildClassName( $this->field['type'], __NAMESPACE__.'\Fields' );
193 201
 		if( class_exists( $className )) {
@@ -205,7 +213,9 @@  discard block
 block discarded – undo
205 213
 	 */
206 214
 	protected function normalizeFieldId()
207 215
 	{
208
-		if( isset( $this->field['id'] ) || $this->field['is_raw'] )return;
216
+		if( isset( $this->field['id'] ) || $this->field['is_raw'] ) {
217
+			return;
218
+		}
209 219
 		$this->field['id'] = glsr( Helper::class )->convertPathToId(
210 220
 			$this->field['path'],
211 221
 			$this->getFieldPrefix()
Please login to merge, or discard this patch.
plugin/Controllers/ListTableController/Columns.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function renderFilters( $postType )
88 88
 	{
89
-		if( $postType !== Application::POST_TYPE )return;
89
+		if( $postType !== Application::POST_TYPE ) {
90
+			return;
91
+		}
90 92
 		if( !( $status = filter_input( INPUT_GET, 'post_status' ))) {
91 93
 			$status = 'publish';
92 94
 		}
@@ -103,7 +105,9 @@  discard block
 block discarded – undo
103 105
 	 */
104 106
 	public function renderValues( $column, $postId )
105 107
 	{
106
-		if( glsr_current_screen()->post_type != Application::POST_TYPE )return;
108
+		if( glsr_current_screen()->post_type != Application::POST_TYPE ) {
109
+			return;
110
+		}
107 111
 		$method = glsr( Helper::class )->buildMethodName( $column, 'buildColumn' );
108 112
 		echo method_exists( $this, $method )
109 113
 			? call_user_func( [$this, $method], $postId )
@@ -116,7 +120,9 @@  discard block
 block discarded – undo
116 120
 	 */
117 121
 	protected function renderFilterRatings( $ratings )
118 122
 	{
119
-		if( empty( $ratings ))return;
123
+		if( empty( $ratings )) {
124
+			return;
125
+		}
120 126
 		$ratings = array_flip( array_reverse( $ratings ));
121 127
 		array_walk( $ratings, function( &$value, $key ) {
122 128
 			$label = _n( '%s star', '%s stars', $key, 'site-reviews' );
@@ -139,7 +145,9 @@  discard block
 block discarded – undo
139 145
 	 */
140 146
 	protected function renderFilterTypes( $types )
141 147
 	{
142
-		if( count( glsr()->reviewTypes ) < 2 )return;
148
+		if( count( glsr()->reviewTypes ) < 2 ) {
149
+			return;
150
+		}
143 151
 		echo glsr( Builder::class )->label( __( 'Filter by type', 'site-reviews' ), [
144 152
 			'class' => 'screen-reader-text',
145 153
 			'for' => 'review_type',
Please login to merge, or discard this patch.
plugin/Controllers/EditorController/Labels.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@
 block discarded – undo
48 48
 	public function filterUpdateMessages( array $messages )
49 49
 	{
50 50
 		$post = get_post();
51
-		if( !( $post instanceof WP_Post ))return;
51
+		if( !( $post instanceof WP_Post )) {
52
+			return;
53
+		}
52 54
 		$strings = $this->getReviewLabels();
53 55
 		$restored = filter_input( INPUT_GET, 'revision' );
54 56
 		if( $revisionTitle = wp_post_revision_title( intval( $restored ), false )) {
Please login to merge, or discard this patch.
plugin/Modules/Email.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,9 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function send()
74 74
 	{
75
-		if( !$this->message || !$this->subject || !$this->to )return;
75
+		if( !$this->message || !$this->subject || !$this->to ) {
76
+			return;
77
+		}
76 78
 		$sent = wp_mail(
77 79
 			$this->to,
78 80
 			$this->subject,
@@ -90,8 +92,12 @@  discard block
 block discarded – undo
90 92
 	 */
91 93
 	public function buildPlainTextMessage( PHPMailer $phpmailer )
92 94
 	{
93
-		if( empty( $this->email ))return;
94
-		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return;
95
+		if( empty( $this->email )) {
96
+			return;
97
+		}
98
+		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) {
99
+			return;
100
+		}
95 101
 		$message = $this->stripHtmlTags( $phpmailer->Body );
96 102
 		$phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this );
97 103
 	}
Please login to merge, or discard this patch.