@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | $filenames = []; |
| 21 | 21 | $iterator = new DirectoryIterator( dirname( __FILE__ ).'/Upgrader' ); |
| 22 | 22 | foreach( $iterator as $fileinfo ) { |
| 23 | - if( !$fileinfo->isFile() )continue; |
|
| 23 | + if( !$fileinfo->isFile() ) { |
|
| 24 | + continue; |
|
| 25 | + } |
|
| 24 | 26 | $filenames[] = $fileinfo->getFilename(); |
| 25 | 27 | } |
| 26 | 28 | natsort( $filenames ); |
@@ -28,7 +30,9 @@ discard block |
||
| 28 | 30 | $className = str_replace( '.php', '', $file ); |
| 29 | 31 | $version = str_replace( ['Upgrade_', '_'], ['', '.'], $className ); |
| 30 | 32 | $versionSuffix = preg_replace( '/[\d.]+(.+)?/', '${1}', glsr()->version ); // allow alpha/beta versions |
| 31 | - if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' ))return; |
|
| 33 | + if( version_compare( $this->currentVersion(), $version.$versionSuffix, '>=' )) { |
|
| 34 | + return; |
|
| 35 | + } |
|
| 32 | 36 | glsr( 'Modules\\Upgrader\\'.$className ); |
| 33 | 37 | glsr_log()->info( 'Completed Upgrade for v'.$version.$versionSuffix ); |
| 34 | 38 | }); |
@@ -203,7 +203,9 @@ discard block |
||
| 203 | 203 | $key = $value; |
| 204 | 204 | $value = true; |
| 205 | 205 | } |
| 206 | - if( !in_array( $key, static::BOOLEAN_ATTRIBUTES ))continue; |
|
| 206 | + if( !in_array( $key, static::BOOLEAN_ATTRIBUTES )) { |
|
| 207 | + continue; |
|
| 208 | + } |
|
| 207 | 209 | $this->attributes[$key] = wp_validate_boolean( $value ); |
| 208 | 210 | } |
| 209 | 211 | } |
@@ -218,7 +220,9 @@ discard block |
||
| 218 | 220 | $key = $value; |
| 219 | 221 | $value = ''; |
| 220 | 222 | } |
| 221 | - if( !glsr( Helper::class )->startsWith( 'data-', $key ))continue; |
|
| 223 | + if( !glsr( Helper::class )->startsWith( 'data-', $key )) { |
|
| 224 | + continue; |
|
| 225 | + } |
|
| 222 | 226 | if( is_array( $value )) { |
| 223 | 227 | $value = json_encode( $value, JSON_HEX_APOS|JSON_NUMERIC_CHECK|JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE ); |
| 224 | 228 | } |
@@ -232,7 +236,9 @@ discard block |
||
| 232 | 236 | protected function normalizeStringAttributes() |
| 233 | 237 | { |
| 234 | 238 | foreach( $this->attributes as $key => $value ) { |
| 235 | - if( !is_string( $value ))continue; |
|
| 239 | + if( !is_string( $value )) { |
|
| 240 | + continue; |
|
| 241 | + } |
|
| 236 | 242 | $this->attributes[$key] = trim( $value ); |
| 237 | 243 | } |
| 238 | 244 | } |
@@ -243,7 +249,9 @@ discard block |
||
| 243 | 249 | */ |
| 244 | 250 | protected function normalizeInputType( $method ) |
| 245 | 251 | { |
| 246 | - if( $method != 'input' )return; |
|
| 252 | + if( $method != 'input' ) { |
|
| 253 | + return; |
|
| 254 | + } |
|
| 247 | 255 | $attributes = wp_parse_args( $this->attributes, ['type' => ''] ); |
| 248 | 256 | if( !in_array( $attributes['type'], static::INPUT_TYPES )) { |
| 249 | 257 | $this->attributes['type'] = 'text'; |
@@ -74,9 +74,13 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $this->newSettings = $this->getNewSettings(); |
| 76 | 76 | $this->oldSettings = $this->getOldSettings(); |
| 77 | - if( empty( $this->oldSettings ))return; |
|
| 77 | + if( empty( $this->oldSettings )) { |
|
| 78 | + return; |
|
| 79 | + } |
|
| 78 | 80 | foreach( static::MAPPED_SETTINGS as $old => $new ) { |
| 79 | - if( empty( $this->oldSettings[$old] ))continue; |
|
| 81 | + if( empty( $this->oldSettings[$old] )) { |
|
| 82 | + continue; |
|
| 83 | + } |
|
| 80 | 84 | $this->newSettings[$new] = $this->oldSettings[$old]; |
| 81 | 85 | } |
| 82 | 86 | $this->migrateNotificationSettings(); |
@@ -136,7 +140,9 @@ discard block |
||
| 136 | 140 | ]; |
| 137 | 141 | $this->newSettings['settings.general.notifications'] = []; |
| 138 | 142 | foreach( $notifications as $old => $new ) { |
| 139 | - if( $this->oldSettings['settings.general.notification'] != $old )continue; |
|
| 143 | + if( $this->oldSettings['settings.general.notification'] != $old ) { |
|
| 144 | + continue; |
|
| 145 | + } |
|
| 140 | 146 | $this->newSettings['settings.general.notifications'][] = $new; |
| 141 | 147 | } |
| 142 | 148 | } |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | public function routeAdminPostRequest() |
| 18 | 18 | { |
| 19 | 19 | $request = $this->getRequest(); |
| 20 | - if( !$this->isValidPostRequest( $request ))return; |
|
| 20 | + if( !$this->isValidPostRequest( $request )) { |
|
| 21 | + return; |
|
| 22 | + } |
|
| 21 | 23 | check_admin_referer( $request['_action'] ); |
| 22 | 24 | $this->routeRequest( 'admin', $request['_action'], $request ); |
| 23 | 25 | } |
@@ -39,10 +41,16 @@ discard block |
||
| 39 | 41 | */ |
| 40 | 42 | public function routePublicPostRequest() |
| 41 | 43 | { |
| 42 | - if( is_admin() )return; |
|
| 44 | + if( is_admin() ) { |
|
| 45 | + return; |
|
| 46 | + } |
|
| 43 | 47 | $request = $this->getRequest(); |
| 44 | - if( !$this->isValidPostRequest( $request ))return; |
|
| 45 | - if( !$this->isValidPublicNonce( $request ))return; |
|
| 48 | + if( !$this->isValidPostRequest( $request )) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 51 | + if( !$this->isValidPublicNonce( $request )) { |
|
| 52 | + return; |
|
| 53 | + } |
|
| 46 | 54 | $this->routeRequest( 'public', $request['_action'], $request ); |
| 47 | 55 | } |
| 48 | 56 | |
@@ -51,7 +59,9 @@ discard block |
||
| 51 | 59 | */ |
| 52 | 60 | protected function checkAjaxNonce( array $request ) |
| 53 | 61 | { |
| 54 | - if( !is_user_logged_in() )return; |
|
| 62 | + if( !is_user_logged_in() ) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 55 | 65 | if( !isset( $request['_nonce'] )) { |
| 56 | 66 | $this->sendAjaxError( 'request is missing a nonce', $request ); |
| 57 | 67 | } |
@@ -39,7 +39,9 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function removeAutosave() |
| 41 | 41 | { |
| 42 | - if( !$this->isReviewEditor() || $this->isReviewEditable() )return; |
|
| 42 | + if( !$this->isReviewEditor() || $this->isReviewEditable() ) { |
|
| 43 | + return; |
|
| 44 | + } |
|
| 43 | 45 | wp_deregister_script( 'autosave' ); |
| 44 | 46 | } |
| 45 | 47 | |
@@ -56,7 +58,9 @@ discard block |
||
| 56 | 58 | */ |
| 57 | 59 | public function removePostTypeSupport() |
| 58 | 60 | { |
| 59 | - if( !$this->isReviewEditor() || $this->isReviewEditable() )return; |
|
| 61 | + if( !$this->isReviewEditor() || $this->isReviewEditable() ) { |
|
| 62 | + return; |
|
| 63 | + } |
|
| 60 | 64 | remove_post_type_support( Application::POST_TYPE, 'title' ); |
| 61 | 65 | remove_post_type_support( Application::POST_TYPE, 'editor' ); |
| 62 | 66 | } |
@@ -8,7 +8,10 @@ |
||
| 8 | 8 | <textarea readonly><?= esc_attr( $post->post_content ); ?></textarea> |
| 9 | 9 | </div> |
| 10 | 10 | |
| 11 | -<?php if( empty( $response ))return; ?> |
|
| 11 | +<?php if( empty( $response )) { |
|
| 12 | + return; |
|
| 13 | +} |
|
| 14 | +?> |
|
| 12 | 15 | |
| 13 | 16 | <div class="postbox glsr-response-postbox"> |
| 14 | 17 | <button type="button" class="handlediv" aria-expanded="true"> |
@@ -13,7 +13,9 @@ |
||
| 13 | 13 | public function getPost( $postId ) |
| 14 | 14 | { |
| 15 | 15 | $postId = trim( $postId ); |
| 16 | - if( empty( $postId ) || !is_numeric( $postId ))return; |
|
| 16 | + if( empty( $postId ) || !is_numeric( $postId )) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | if( $this->isEnabled() ) { |
| 18 | 20 | $polylangPostId = pll_get_post( $postId, pll_get_post_language( get_the_ID() )); |
| 19 | 21 | } |
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function download( $filename, $content ) |
| 17 | 17 | { |
| 18 | - if( !current_user_can( glsr()->constant( 'CAPABILITY' )))return; |
|
| 18 | + if( !current_user_can( glsr()->constant( 'CAPABILITY' ))) { |
|
| 19 | + return; |
|
| 20 | + } |
|
| 19 | 21 | nocache_headers(); |
| 20 | 22 | header( 'Content-Type: text/plain' ); |
| 21 | 23 | header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); |
@@ -33,7 +33,8 @@ |
||
| 33 | 33 | protected $settings; |
| 34 | 34 | protected $taxonomy; |
| 35 | 35 | |
| 36 | - public function __construct( Application $app ) { |
|
| 36 | + public function __construct( Application $app ) |
|
| 37 | + { |
|
| 37 | 38 | $this->app = $app; |
| 38 | 39 | $this->admin = $app->make( AdminController::class ); |
| 39 | 40 | $this->blocks = $app->make( BlocksController::class ); |