@@ -102,7 +102,8 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | try { |
| 104 | 104 | $reflector = new ReflectionClass($concrete); // class or classname provided |
| 105 | - } catch (ReflectionException $e) { |
|
| 105 | + } |
|
| 106 | + catch (ReflectionException $e) { |
|
| 106 | 107 | throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e); |
| 107 | 108 | } |
| 108 | 109 | if (!$reflector->isInstantiable()) { |
@@ -115,7 +116,8 @@ discard block |
||
| 115 | 116 | } |
| 116 | 117 | try { |
| 117 | 118 | $instances = $this->resolveDependencies($constructor->getParameters()); // resolve class dependencies |
| 118 | - } catch (BindingResolutionException $e) { |
|
| 119 | + } |
|
| 120 | + catch (BindingResolutionException $e) { |
|
| 119 | 121 | array_pop($this->buildStack); |
| 120 | 122 | throw $e; |
| 121 | 123 | } |
@@ -235,7 +237,8 @@ discard block |
||
| 235 | 237 | { |
| 236 | 238 | try { |
| 237 | 239 | return $this->make($parameter->getClass()->name); |
| 238 | - } catch (Exception $error) { |
|
| 240 | + } |
|
| 241 | + catch (Exception $error) { |
|
| 239 | 242 | if ($parameter->isOptional()) { |
| 240 | 243 | return $parameter->getDefaultValue(); |
| 241 | 244 | } |
@@ -284,7 +287,8 @@ discard block |
||
| 284 | 287 | { |
| 285 | 288 | if (empty($this->buildStack)) { |
| 286 | 289 | $message = "Target [$concrete] is not instantiable."; |
| 287 | - } else { |
|
| 290 | + } |
|
| 291 | + else { |
|
| 288 | 292 | $previous = implode(', ', $this->buildStack); |
| 289 | 293 | $message = "Target [$concrete] is not instantiable while building [$previous]."; |
| 290 | 294 | } |
@@ -287,7 +287,8 @@ |
||
| 287 | 287 | $this->bind($id, $addon); |
| 288 | 288 | $addon->init(); |
| 289 | 289 | } |
| 290 | - } catch (\ReflectionException $e) { |
|
| 290 | + } |
|
| 291 | + catch (\ReflectionException $e) { |
|
| 291 | 292 | glsr_log()->error('Attempted to register an invalid addon.'); |
| 292 | 293 | } |
| 293 | 294 | } |
@@ -25,7 +25,8 @@ |
||
| 25 | 25 | } |
| 26 | 26 | if ($key) { |
| 27 | 27 | $stored[$key] = $value; |
| 28 | - } else { |
|
| 28 | + } |
|
| 29 | + else { |
|
| 29 | 30 | $stored[] = $value; |
| 30 | 31 | } |
| 31 | 32 | $this->store($property, $stored); |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | 'class' => 'glsr-review-count', |
| 83 | 83 | 'href' => 'edit.php?post_type='.Application::POST_TYPE, |
| 84 | 84 | ]); |
| 85 | - } else { |
|
| 85 | + } |
|
| 86 | + else { |
|
| 86 | 87 | $items[] = glsr(Builder::class)->span($text, [ |
| 87 | 88 | 'class' => 'glsr-review-count', |
| 88 | 89 | ]); |
@@ -164,7 +165,8 @@ discard block |
||
| 164 | 165 | _x('Site Reviews was unable to detect an IP address. To fix this, please see the %s.', 'admin-text', 'site-reviews'), |
| 165 | 166 | $link |
| 166 | 167 | )); |
| 167 | - } else { |
|
| 168 | + } |
|
| 169 | + else { |
|
| 168 | 170 | glsr(Notice::class)->addSuccess(sprintf( |
| 169 | 171 | _x('Your detected IP address is %s. If this looks incorrect, please see the %s.', 'admin-text', 'site-reviews'), |
| 170 | 172 | '<code>'.$ipAddress.'</code>', $link |
@@ -220,7 +222,8 @@ discard block |
||
| 220 | 222 | if (wp_validate_boolean($request->alt)) { |
| 221 | 223 | glsr(Migrate::class)->runAll(); |
| 222 | 224 | glsr(Notice::class)->clear()->addSuccess(_x('All plugin migrations have been run successfully.', 'admin-text', 'site-reviews')); |
| 223 | - } else { |
|
| 225 | + } |
|
| 226 | + else { |
|
| 224 | 227 | glsr(Migrate::class)->run(); |
| 225 | 228 | glsr(Notice::class)->clear()->addSuccess(_x('The plugin has been migrated sucessfully.', 'admin-text', 'site-reviews')); |
| 226 | 229 | } |
@@ -50,7 +50,8 @@ |
||
| 50 | 50 | { |
| 51 | 51 | if (glsr(Database::class)->isMigrationNeeded()) { |
| 52 | 52 | $this->runAll(); |
| 53 | - } else { |
|
| 53 | + } |
|
| 54 | + else { |
|
| 54 | 55 | $this->runMigrations(); |
| 55 | 56 | } |
| 56 | 57 | } |
@@ -157,7 +157,8 @@ |
||
| 157 | 157 | } |
| 158 | 158 | if (in_array($field->field['type'], ['radio', 'checkbox'])) { |
| 159 | 159 | $field->field['checked'] = $field->field['value'] == $this->with->values[$field->field['path']]; |
| 160 | - } else { |
|
| 160 | + } |
|
| 161 | + else { |
|
| 161 | 162 | $field->field['value'] = $this->with->values[$field->field['path']]; |
| 162 | 163 | } |
| 163 | 164 | } |
@@ -206,9 +206,11 @@ |
||
| 206 | 206 | $orderby = $this->args['orderby']; |
| 207 | 207 | if (Str::startsWith('p.', $orderby)) { |
| 208 | 208 | $orderBy = "ORDER BY r.is_pinned {$order}, {$orderby} {$order}"; |
| 209 | - } elseif (array_key_exists($orderby, $values)) { |
|
| 209 | + } |
|
| 210 | + elseif (array_key_exists($orderby, $values)) { |
|
| 210 | 211 | $orderBy = $orderby; |
| 211 | - } else { |
|
| 212 | + } |
|
| 213 | + else { |
|
| 212 | 214 | $orderBy = ''; |
| 213 | 215 | } |
| 214 | 216 | return glsr()->filterString('query/sql/order-by', $orderBy, $this); |
@@ -71,7 +71,8 @@ |
||
| 71 | 71 | $this->setArgs($args); |
| 72 | 72 | if (!empty($postIds)) { |
| 73 | 73 | $postIds = implode(',', Arr::uniqueInt($postIds)); |
| 74 | - } else { |
|
| 74 | + } |
|
| 75 | + else { |
|
| 75 | 76 | $postIds = "SELECT ids.* FROM ( |
| 76 | 77 | SELECT r.review_id |
| 77 | 78 | {$this->sqlFrom()} |
@@ -158,7 +158,8 @@ |
||
| 158 | 158 | glsr(ReviewManager::class)->update($post->ID, [ |
| 159 | 159 | 'is_approved' => 'publish' === $newStatus, |
| 160 | 160 | ]); |
| 161 | - } else { |
|
| 161 | + } |
|
| 162 | + else { |
|
| 162 | 163 | glsr(ReviewManager::class)->updateAssignedPost($post->ID, [ |
| 163 | 164 | 'is_published' => 'publish' === $newStatus, |
| 164 | 165 | ]); |