@@ -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 | } |
@@ -6,7 +6,9 @@ |
||
6 | 6 | { |
7 | 7 | public function get( $metaKey, array $args = [] ) |
8 | 8 | { |
9 | - if( empty( $metaKey ))return; |
|
9 | + if( empty( $metaKey )) { |
|
10 | + return; |
|
11 | + } |
|
10 | 12 | |
11 | 13 | $args = $this->normalize( $args ); |
12 | 14 | $metaKey = $this->buildMetaKey( $metaKey, $args['prefix'] ); |
@@ -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 | } |