@@ -8,8 +8,7 @@ |
||
8 | 8 | use GeminiLabs\Castor\Facades\Utility; |
9 | 9 | use WP_Customize_Manager; |
10 | 10 | |
11 | -class Controller |
|
12 | -{ |
|
11 | +class Controller { |
|
13 | 12 | /** |
14 | 13 | * @return void |
15 | 14 | * @action after_setup_theme |
@@ -4,6 +4,5 @@ |
||
4 | 4 | |
5 | 5 | use Exception; |
6 | 6 | |
7 | -class BindingResolutionException extends Exception |
|
8 | -{ |
|
7 | +class BindingResolutionException extends Exception { |
|
9 | 8 | } |
@@ -2,8 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace GeminiLabs\Castor; |
4 | 4 | |
5 | -class AliasLoader |
|
6 | -{ |
|
5 | +class AliasLoader { |
|
7 | 6 | /** |
8 | 7 | * The singleton instance of the loader. |
9 | 8 | * |
@@ -31,7 +30,8 @@ discard block |
||
31 | 30 | } |
32 | 31 | |
33 | 32 | private function __clone() |
34 | - {} |
|
33 | + { |
|
34 | +} |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Get or create the singleton alias loader instance. |
@@ -5,8 +5,7 @@ |
||
5 | 5 | use GeminiLabs\Castor\Application; |
6 | 6 | use RuntimeException; |
7 | 7 | |
8 | -abstract class Facade |
|
9 | -{ |
|
8 | +abstract class Facade { |
|
10 | 9 | /** |
11 | 10 | * The application instance being facaded. |
12 | 11 | * |
@@ -5,8 +5,7 @@ discard block |
||
5 | 5 | use GeminiLabs\Castor\Helpers\PostMeta; |
6 | 6 | use GeminiLabs\Castor\Helpers\Utility; |
7 | 7 | |
8 | -class Image |
|
9 | -{ |
|
8 | +class Image { |
|
10 | 9 | public $image; |
11 | 10 | |
12 | 11 | protected $postmeta; |
@@ -59,7 +58,9 @@ discard block |
||
59 | 58 | |
60 | 59 | $attachment = get_post( $attachmentId ); |
61 | 60 | |
62 | - if( is_null( $attachment ) || $attachment->post_type != 'attachment' )return; |
|
61 | + if( is_null( $attachment ) || $attachment->post_type != 'attachment' ) { |
|
62 | + return; |
|
63 | + } |
|
63 | 64 | |
64 | 65 | return $attachment->ID; |
65 | 66 | } |
@@ -5,8 +5,7 @@ discard block |
||
5 | 5 | use BadMethodCallException; |
6 | 6 | use InvalidArgumentException; |
7 | 7 | |
8 | -class Validator |
|
9 | -{ |
|
8 | +class Validator { |
|
10 | 9 | /** |
11 | 10 | * @var array |
12 | 11 | */ |
@@ -78,7 +77,9 @@ discard block |
||
78 | 77 | foreach( $rules as $rule ) { |
79 | 78 | $this->validateAttribute( $rule, $attribute ); |
80 | 79 | |
81 | - if( $this->shouldStopValidating( $attribute ))break; |
|
80 | + if( $this->shouldStopValidating( $attribute )) { |
|
81 | + break; |
|
82 | + } |
|
82 | 83 | } |
83 | 84 | } |
84 | 85 | |
@@ -161,7 +162,9 @@ discard block |
||
161 | 162 | */ |
162 | 163 | protected function getRule( $attribute, $rules ) |
163 | 164 | { |
164 | - if( !array_key_exists( $attribute, $this->rules ))return; |
|
165 | + if( !array_key_exists( $attribute, $this->rules )) { |
|
166 | + return; |
|
167 | + } |
|
165 | 168 | |
166 | 169 | $rules = (array) $rules; |
167 | 170 | |
@@ -420,7 +423,9 @@ discard block |
||
420 | 423 | ? $strings[ $key ] |
421 | 424 | : false; |
422 | 425 | |
423 | - if( !$message )return; |
|
426 | + if( !$message ) { |
|
427 | + return; |
|
428 | + } |
|
424 | 429 | |
425 | 430 | $message = str_replace( ':attribute', $attribute, $message ); |
426 | 431 | |
@@ -463,7 +468,9 @@ discard block |
||
463 | 468 | { |
464 | 469 | list( $rule, $parameters ) = $this->parseRule( $rule ); |
465 | 470 | |
466 | - if( $rule == '' )return; |
|
471 | + if( $rule == '' ) { |
|
472 | + return; |
|
473 | + } |
|
467 | 474 | |
468 | 475 | $method = "validate{$rule}"; |
469 | 476 |
@@ -4,8 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use GeminiLabs\Castor\Helpers\Template; |
6 | 6 | |
7 | -class Email |
|
8 | -{ |
|
7 | +class Email { |
|
9 | 8 | /** |
10 | 9 | * @var Template |
11 | 10 | */ |
@@ -55,7 +54,9 @@ discard block |
||
55 | 54 | $this->to = $email['to']; |
56 | 55 | |
57 | 56 | add_action( 'phpmailer_init', function( PHPMailer $phpmailer ) { |
58 | - if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return; |
|
57 | + if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) { |
|
58 | + return; |
|
59 | + } |
|
59 | 60 | $phpmailer->AltBody = $this->buildPlainTextMessage( $phpmailer->Body ); |
60 | 61 | }); |
61 | 62 | |
@@ -79,7 +80,9 @@ discard block |
||
79 | 80 | */ |
80 | 81 | public function send() |
81 | 82 | { |
82 | - if( !$this->message || !$this->subject || !$this->to )return; |
|
83 | + if( !$this->message || !$this->subject || !$this->to ) { |
|
84 | + return; |
|
85 | + } |
|
83 | 86 | |
84 | 87 | $sent = wp_mail( |
85 | 88 | $this->to, |
@@ -209,7 +212,9 @@ discard block |
||
209 | 212 | if( !file_exists( $file )) { |
210 | 213 | $file = sprintf( '%s/templates/%s.php', dirname( __DIR__ ), $templatePath ); |
211 | 214 | } |
212 | - if( !file_exists( $file ))return; |
|
215 | + if( !file_exists( $file )) { |
|
216 | + return; |
|
217 | + } |
|
213 | 218 | |
214 | 219 | ob_start(); |
215 | 220 | include $file; |
@@ -2,8 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace GeminiLabs\Castor\Services; |
4 | 4 | |
5 | -class Normalizer |
|
6 | -{ |
|
5 | +class Normalizer { |
|
7 | 6 | const BOOLEAN_ATTRIBUTES = [ |
8 | 7 | 'autofocus', 'capture', 'checked', 'disabled', 'draggable', 'formnovalidate', 'hidden', |
9 | 8 | 'multiple', 'novalidate', 'readonly', 'required', 'selected', 'spellcheck', |
@@ -148,7 +147,9 @@ discard block |
||
148 | 147 | |
149 | 148 | // normalize truthy boolean attributes |
150 | 149 | foreach( $filtered as $key => $value ) { |
151 | - if( !in_array( $key, self::BOOLEAN_ATTRIBUTES ))continue; |
|
150 | + if( !in_array( $key, self::BOOLEAN_ATTRIBUTES )) { |
|
151 | + continue; |
|
152 | + } |
|
152 | 153 | |
153 | 154 | if( $value !== false ) { |
154 | 155 | $filtered[ $key ] = ''; |
@@ -187,11 +188,15 @@ discard block |
||
187 | 188 | |
188 | 189 | if( $result ) { |
189 | 190 | // only allow data attributes to have an empty value |
190 | - if( $wildcard != 'data-' && empty( $value ))continue; |
|
191 | + if( $wildcard != 'data-' && empty( $value )) { |
|
192 | + continue; |
|
193 | + } |
|
191 | 194 | |
192 | 195 | if( is_array( $value )) { |
193 | 196 | |
194 | - if( $wildcard != 'data-' )continue; |
|
197 | + if( $wildcard != 'data-' ) { |
|
198 | + continue; |
|
199 | + } |
|
195 | 200 | |
196 | 201 | $value = json_encode( $value ); |
197 | 202 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use GeminiLabs\Castor\Facade; |
6 | 6 | |
7 | -class Utility extends Facade |
|
8 | -{ |
|
7 | +class Utility extends Facade { |
|
9 | 8 | /** |
10 | 9 | * Get the fully qualified class name of the component. |
11 | 10 | * |