@@ -17,7 +17,8 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | <?php if (empty($table) || empty($action)): ?> |
| 19 | 19 | // |
| 20 | -<?php else: ?> |
|
| 20 | +<?php else { |
|
| 21 | + : ?> |
|
| 21 | 22 | $this-><?= $action ?>('<?= $table ?>', function(Structure $table) { |
| 22 | 23 | <?php if ($session): ?> |
| 23 | 24 | $table->string('id', 128); |
@@ -28,12 +29,17 @@ discard block |
||
| 28 | 29 | $table->primary(['id', 'ip_address']); |
| 29 | 30 | <?php else: ?> |
| 30 | 31 | $table->primary('id'); |
| 31 | -<?php endif; ?> |
|
| 32 | +<?php endif; |
|
| 33 | +} |
|
| 34 | +?> |
|
| 32 | 35 | $table->index('timestamp'); |
| 33 | -<?php else: ?> |
|
| 36 | +<?php else { |
|
| 37 | + : ?> |
|
| 34 | 38 | $table->id(); |
| 35 | 39 | $table->timestamps(); |
| 36 | -<?php endif; ?> |
|
| 40 | +<?php endif; |
|
| 41 | +} |
|
| 42 | +?> |
|
| 37 | 43 | |
| 38 | 44 | return $table; |
| 39 | 45 | }); |
@@ -46,10 +52,13 @@ discard block |
||
| 46 | 52 | // |
| 47 | 53 | <?php elseif ($action === 'create') : ?> |
| 48 | 54 | $this->dropIfExists('<?= $table ?>'); |
| 49 | -<?php else: ?> |
|
| 55 | +<?php else { |
|
| 56 | + : ?> |
|
| 50 | 57 | $this->modify('<?= $table ?>', function(Structure $table) { |
| 51 | 58 | // |
| 52 | 59 | }); |
| 53 | -<?php endif; ?> |
|
| 60 | +<?php endif; |
|
| 61 | +} |
|
| 62 | +?> |
|
| 54 | 63 | } |
| 55 | 64 | } |
@@ -276,8 +276,7 @@ |
||
| 276 | 276 | $this->sectionStack[] = $name; |
| 277 | 277 | |
| 278 | 278 | ob_start(); |
| 279 | - } |
|
| 280 | - else { |
|
| 279 | + } else { |
|
| 281 | 280 | $this->sections[$name] = [$content]; |
| 282 | 281 | } |
| 283 | 282 | } |
@@ -73,12 +73,10 @@ discard block |
||
| 73 | 73 | if (! empty($viewPathLocator)) { |
| 74 | 74 | if (is_string($viewPathLocator)) { |
| 75 | 75 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
| 76 | - } |
|
| 77 | - else if ($viewPathLocator instanceof Locator) { |
|
| 76 | + } else if ($viewPathLocator instanceof Locator) { |
|
| 78 | 77 | $this->locator = $viewPathLocator; |
| 79 | 78 | } |
| 80 | - } |
|
| 81 | - else { |
|
| 79 | + } else { |
|
| 82 | 80 | $this->locator = Services::locator(); |
| 83 | 81 | } |
| 84 | 82 | } |
@@ -225,8 +223,7 @@ discard block |
||
| 225 | 223 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
| 226 | 224 | if (! empty($viewPath)) { |
| 227 | 225 | $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')); |
| 228 | - } |
|
| 229 | - else { |
|
| 226 | + } else { |
|
| 230 | 227 | $file = $view; |
| 231 | 228 | } |
| 232 | 229 | |
@@ -36,8 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | try { |
| 38 | 38 | return $this->validation($rules, $messages)->safe(); |
| 39 | - } |
|
| 40 | - catch (DimtrovichValidationException $e) { |
|
| 39 | + } catch (DimtrovichValidationException $e) { |
|
| 41 | 40 | $th = new ValidationException($e->getMessage()); |
| 42 | 41 | $th->setErrors([$e->getMessage()]); |
| 43 | 42 | throw $th; |
@@ -828,8 +828,7 @@ discard block |
||
| 828 | 828 | |
| 829 | 829 | try { |
| 830 | 830 | $response = $response->withBody(to_stream($returned)); |
| 831 | - } |
|
| 832 | - catch (InvalidArgumentException $e) { |
|
| 831 | + } catch (InvalidArgumentException $e) { |
|
| 833 | 832 | } |
| 834 | 833 | |
| 835 | 834 | return $response; |
@@ -917,8 +916,7 @@ discard block |
||
| 917 | 916 | Services::event()->trigger('post_system'); |
| 918 | 917 | |
| 919 | 918 | return $_this->formatResponse($response, $returned); |
| 920 | - } |
|
| 921 | - catch (ValidationException $e) { |
|
| 919 | + } catch (ValidationException $e) { |
|
| 922 | 920 | $code = $e->getCode(); |
| 923 | 921 | $errors = $e->getErrors(); |
| 924 | 922 | if (empty($errors)) { |
@@ -929,8 +927,7 @@ discard block |
||
| 929 | 927 | if (strtoupper($request->getMethod()) === 'POST') { |
| 930 | 928 | if (is_subclass_of($_this->controller, ApplicationController::class)) { |
| 931 | 929 | return Services::redirection()->back()->withInput()->withErrors($errors)->withStatus($code); |
| 932 | - } |
|
| 933 | - else if (is_subclass_of($_this->controller, RestController::class)) { |
|
| 930 | + } else if (is_subclass_of($_this->controller, RestController::class)) { |
|
| 934 | 931 | return $_this->formatResponse($response->withStatus($code), [ |
| 935 | 932 | 'success' => false, |
| 936 | 933 | 'code' => $code, |
@@ -938,8 +935,7 @@ discard block |
||
| 938 | 935 | ]); |
| 939 | 936 | } |
| 940 | 937 | } |
| 941 | - } |
|
| 942 | - else if (strtoupper($request->getMethod()) === 'POST') { |
|
| 938 | + } else if (strtoupper($request->getMethod()) === 'POST') { |
|
| 943 | 939 | return Services::redirection()->back()->withInput()->withErrors($errors)->withStatus($code); |
| 944 | 940 | } |
| 945 | 941 | |