@@ -221,7 +221,8 @@ |
||
| 221 | 221 | if ($flattenValue) { |
| 222 | 222 | $value = '['.implode(', ', $value).']'; |
| 223 | 223 | } |
| 224 | - } elseif (is_array($value)) { |
|
| 224 | + } |
|
| 225 | + elseif (is_array($value)) { |
|
| 225 | 226 | $result = array_merge($result, $this->flattenArray($value, $flattenValue, $newKey)); |
| 226 | 227 | continue; |
| 227 | 228 | } |
@@ -68,9 +68,11 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | if (!property_exists($this, $property) || in_array($property, static::PROTECTED_PROPERTIES)) { |
| 70 | 70 | $this->storage[$property] = $value; |
| 71 | - } elseif (!isset($this->$property)) { |
|
| 71 | + } |
|
| 72 | + elseif (!isset($this->$property)) { |
|
| 72 | 73 | $this->$property = $value; |
| 73 | - } else { |
|
| 74 | + } |
|
| 75 | + else { |
|
| 74 | 76 | throw new Exception(sprintf('The "%s" property cannot be changed once set.', $property)); |
| 75 | 77 | } |
| 76 | 78 | } |
@@ -165,7 +167,8 @@ discard block |
||
| 165 | 167 | { |
| 166 | 168 | try { |
| 167 | 169 | return $this->make($parameter->getClass()->name); |
| 168 | - } catch (Exception $error) { |
|
| 170 | + } |
|
| 171 | + catch (Exception $error) { |
|
| 169 | 172 | if ($parameter->isOptional()) { |
| 170 | 173 | return $parameter->getDefaultValue(); |
| 171 | 174 | } |
@@ -148,7 +148,8 @@ |
||
| 148 | 148 | { |
| 149 | 149 | if ('parent_id' == $postId) { |
| 150 | 150 | $postId = intval(wp_get_post_parent_id(intval(get_the_ID()))); |
| 151 | - } elseif ('post_id' == $postId) { |
|
| 151 | + } |
|
| 152 | + elseif ('post_id' == $postId) { |
|
| 152 | 153 | $postId = intval(get_the_ID()); |
| 153 | 154 | } |
| 154 | 155 | return $postId; |
@@ -318,7 +318,8 @@ |
||
| 318 | 318 | $alert = esc_html__('Some of the shortcode options are required.', 'site-reviews'); |
| 319 | 319 | if (isset($args['required']['alert'])) { |
| 320 | 320 | $alert = $args['required']['alert']; |
| 321 | - } elseif (!empty($args['label'])) { |
|
| 321 | + } |
|
| 322 | + elseif (!empty($args['label'])) { |
|
| 322 | 323 | $alert = sprintf( |
| 323 | 324 | esc_html_x('The "%s" option is required.', 'the option label', 'site-reviews'), |
| 324 | 325 | str_replace(':', '', $args['label']) |
@@ -38,7 +38,8 @@ |
||
| 38 | 38 | } |
| 39 | 39 | try { |
| 40 | 40 | return glsr($handlerClass)->handle($command); |
| 41 | - } catch (Exception $e) { |
|
| 41 | + } |
|
| 42 | + catch (Exception $e) { |
|
| 42 | 43 | status_header(400); |
| 43 | 44 | glsr(Notice::class)->addError(new WP_Error('site_reviews_error', $e->getMessage())); |
| 44 | 45 | glsr_log()->error($e->getMessage()); |
@@ -102,7 +102,8 @@ |
||
| 102 | 102 | if (!glsr(Polylang::class)->isActive()) { |
| 103 | 103 | glsr(Notice::class)->addError(__('Please install/activate the Polylang plugin to enable integration.', 'site-reviews')); |
| 104 | 104 | return false; |
| 105 | - } elseif (!glsr(Polylang::class)->isSupported()) { |
|
| 105 | + } |
|
| 106 | + elseif (!glsr(Polylang::class)->isSupported()) { |
|
| 106 | 107 | glsr(Notice::class)->addError(__('Please update the Polylang plugin to v2.3.0 or greater to enable integration.', 'site-reviews')); |
| 107 | 108 | return false; |
| 108 | 109 | } |
@@ -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); |
@@ -116,7 +116,8 @@ |
||
| 116 | 116 | ]; |
| 117 | 117 | if (is_numeric($searchTerm)) { |
| 118 | 118 | $args['post__in'] = [$searchTerm]; |
| 119 | - } else { |
|
| 119 | + } |
|
| 120 | + else { |
|
| 120 | 121 | $args['orderby'] = 'relevance'; |
| 121 | 122 | $args['posts_per_page'] = 10; |
| 122 | 123 | $args['s'] = $searchTerm; |
@@ -120,7 +120,8 @@ |
||
| 120 | 120 | sprintf($messages[1], $messages[3].' '.$this->versions['php']), |
| 121 | 121 | sprintf($messages[2], PHP_VERSION).'</p><p>'.$rollbackMessage |
| 122 | 122 | ); |
| 123 | - } elseif (!$this->isWpValid()) { |
|
| 123 | + } |
|
| 124 | + elseif (!$this->isWpValid()) { |
|
| 124 | 125 | printf($noticeTemplate, |
| 125 | 126 | sprintf($messages[0], $pluginName), |
| 126 | 127 | sprintf($messages[1], $messages[4].' '.$this->versions['wordpress']), |