@@ -185,8 +185,7 @@ |
||
185 | 185 | { |
186 | 186 | try { |
187 | 187 | return $this->make( $parameter->getClass()->name ); |
188 | - } |
|
189 | - catch( BindingResolutionException $e ) { |
|
188 | + } catch( BindingResolutionException $e ) { |
|
190 | 189 | if( $parameter->isOptional() ) { |
191 | 190 | return $parameter->getDefaultValue(); |
192 | 191 | } |
@@ -72,7 +72,9 @@ |
||
72 | 72 | public function pageTitle() |
73 | 73 | { |
74 | 74 | foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) { |
75 | - if( !$bool() )continue; |
|
75 | + if( !$bool() ) { |
|
76 | + continue; |
|
77 | + } |
|
76 | 78 | $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ))); |
77 | 79 | return $this->$method(); |
78 | 80 | } |
@@ -33,7 +33,9 @@ discard block |
||
33 | 33 | { |
34 | 34 | $post = get_post( $postId ); |
35 | 35 | |
36 | - if( !$postId || !$post )return; |
|
36 | + if( !$postId || !$post ) { |
|
37 | + return; |
|
38 | + } |
|
37 | 39 | if( !$title ) { |
38 | 40 | $title = $post->post_title; |
39 | 41 | } |
@@ -71,7 +73,9 @@ discard block |
||
71 | 73 | ? $this->postmeta->get( $metaKey ) |
72 | 74 | : $this->theme->pageTitle(); |
73 | 75 | |
74 | - if( !$value )return; |
|
76 | + if( !$value ) { |
|
77 | + return; |
|
78 | + } |
|
75 | 79 | |
76 | 80 | $this->utility->printTag( $tag, wp_strip_all_tags( $value ), $attributes ); |
77 | 81 | } |
@@ -59,7 +59,9 @@ |
||
59 | 59 | |
60 | 60 | $attachment = get_post( $attachmentId ); |
61 | 61 | |
62 | - if( is_null( $attachment ) || $attachment->post_type != 'attachment' )return; |
|
62 | + if( is_null( $attachment ) || $attachment->post_type != 'attachment' ) { |
|
63 | + return; |
|
64 | + } |
|
63 | 65 | |
64 | 66 | return $attachment->ID; |
65 | 67 | } |
@@ -41,7 +41,9 @@ discard block |
||
41 | 41 | |
42 | 42 | public function render() |
43 | 43 | { |
44 | - if( !isset( $this->video->html ))return; |
|
44 | + if( !isset( $this->video->html )) { |
|
45 | + return; |
|
46 | + } |
|
45 | 47 | return sprintf( |
46 | 48 | '<div class="video embed">%s%s</div>', |
47 | 49 | $this->renderScreenshot(), |
@@ -114,7 +116,9 @@ discard block |
||
114 | 116 | |
115 | 117 | foreach( $this->args as $key => $value ) { |
116 | 118 | $method = $this->utility->buildMethodName( $key, 'set' ); |
117 | - if( !method_exists( $this, $method ))continue; |
|
119 | + if( !method_exists( $this, $method )) { |
|
120 | + continue; |
|
121 | + } |
|
118 | 122 | call_user_func([ $this, $method ], $value ); |
119 | 123 | } |
120 | 124 | return $this->args; |
@@ -37,8 +37,12 @@ |
||
37 | 37 | 'width' => 1280, |
38 | 38 | 'height' => 1280, |
39 | 39 | ]); |
40 | - if( $request === false )return; |
|
41 | - if( !empty( $args['embed_type'] ) && $args['embed_type'] != $request->type )return; |
|
40 | + if( $request === false ) { |
|
41 | + return; |
|
42 | + } |
|
43 | + if( !empty( $args['embed_type'] ) && $args['embed_type'] != $request->type ) { |
|
44 | + return; |
|
45 | + } |
|
42 | 46 | return $this->modifyRequest( $request, $args ); |
43 | 47 | } |
44 | 48 |
@@ -62,7 +62,9 @@ discard block |
||
62 | 62 | $this->to = $email['to']; |
63 | 63 | |
64 | 64 | add_action( 'phpmailer_init', function( PHPMailer $phpmailer ) { |
65 | - if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return; |
|
65 | + if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) { |
|
66 | + return; |
|
67 | + } |
|
66 | 68 | $phpmailer->AltBody = $this->buildPlainTextMessage( $phpmailer->Body ); |
67 | 69 | }); |
68 | 70 | |
@@ -86,7 +88,9 @@ discard block |
||
86 | 88 | */ |
87 | 89 | public function send() |
88 | 90 | { |
89 | - if( !$this->message || !$this->subject || !$this->to )return; |
|
91 | + if( !$this->message || !$this->subject || !$this->to ) { |
|
92 | + return; |
|
93 | + } |
|
90 | 94 | |
91 | 95 | $sent = wp_mail( |
92 | 96 | $this->to, |
@@ -226,7 +230,9 @@ discard block |
||
226 | 230 | if( !file_exists( $file )) { |
227 | 231 | $file = sprintf( '%s/templates/%s.php', dirname( __DIR__ ), $templatePath ); |
228 | 232 | } |
229 | - if( !file_exists( $file ))return; |
|
233 | + if( !file_exists( $file )) { |
|
234 | + return; |
|
235 | + } |
|
230 | 236 | |
231 | 237 | ob_start(); |
232 | 238 | include $file; |
@@ -148,7 +148,9 @@ discard block |
||
148 | 148 | |
149 | 149 | // normalize truthy boolean attributes |
150 | 150 | foreach( $filtered as $key => $value ) { |
151 | - if( !in_array( $key, self::BOOLEAN_ATTRIBUTES ))continue; |
|
151 | + if( !in_array( $key, self::BOOLEAN_ATTRIBUTES )) { |
|
152 | + continue; |
|
153 | + } |
|
152 | 154 | |
153 | 155 | if( $value !== false ) { |
154 | 156 | $filtered[ $key ] = ''; |
@@ -187,11 +189,15 @@ discard block |
||
187 | 189 | |
188 | 190 | if( $result ) { |
189 | 191 | // only allow data attributes to have an empty value |
190 | - if( $wildcard != 'data-' && empty( $value ))continue; |
|
192 | + if( $wildcard != 'data-' && empty( $value )) { |
|
193 | + continue; |
|
194 | + } |
|
191 | 195 | |
192 | 196 | if( is_array( $value )) { |
193 | 197 | |
194 | - if( $wildcard != 'data-' )continue; |
|
198 | + if( $wildcard != 'data-' ) { |
|
199 | + continue; |
|
200 | + } |
|
195 | 201 | |
196 | 202 | $value = json_encode( $value ); |
197 | 203 | } |
@@ -78,7 +78,9 @@ discard block |
||
78 | 78 | foreach( $rules as $rule ) { |
79 | 79 | $this->validateAttribute( $rule, $attribute ); |
80 | 80 | |
81 | - if( $this->shouldStopValidating( $attribute ))break; |
|
81 | + if( $this->shouldStopValidating( $attribute )) { |
|
82 | + break; |
|
83 | + } |
|
82 | 84 | } |
83 | 85 | } |
84 | 86 | |
@@ -161,7 +163,9 @@ discard block |
||
161 | 163 | */ |
162 | 164 | protected function getRule( $attribute, $rules ) |
163 | 165 | { |
164 | - if( !array_key_exists( $attribute, $this->rules ))return; |
|
166 | + if( !array_key_exists( $attribute, $this->rules )) { |
|
167 | + return; |
|
168 | + } |
|
165 | 169 | |
166 | 170 | $rules = (array) $rules; |
167 | 171 | |
@@ -188,8 +192,7 @@ discard block |
||
188 | 192 | |
189 | 193 | if( is_numeric( $value ) && $hasNumeric ) { |
190 | 194 | return $value; |
191 | - } |
|
192 | - elseif( is_array( $value )) { |
|
195 | + } elseif( is_array( $value )) { |
|
193 | 196 | return count( $value ); |
194 | 197 | } |
195 | 198 | |
@@ -253,8 +256,7 @@ discard block |
||
253 | 256 | // If an object was provided, get its public properties |
254 | 257 | if( is_object( $data )) { |
255 | 258 | $this->data = get_object_vars( $data ); |
256 | - } |
|
257 | - else { |
|
259 | + } else { |
|
258 | 260 | $this->data = $data; |
259 | 261 | } |
260 | 262 | |
@@ -420,7 +422,9 @@ discard block |
||
420 | 422 | ? $strings[ $key ] |
421 | 423 | : false; |
422 | 424 | |
423 | - if( !$message )return; |
|
425 | + if( !$message ) { |
|
426 | + return; |
|
427 | + } |
|
424 | 428 | |
425 | 429 | $message = str_replace( ':attribute', $attribute, $message ); |
426 | 430 | |
@@ -464,7 +468,9 @@ discard block |
||
464 | 468 | { |
465 | 469 | list( $rule, $parameters ) = $this->parseRule( $rule ); |
466 | 470 | |
467 | - if( $rule == '' )return; |
|
471 | + if( $rule == '' ) { |
|
472 | + return; |
|
473 | + } |
|
468 | 474 | |
469 | 475 | $method = "validate{$rule}"; |
470 | 476 |