@@ -65,9 +65,9 @@ |
||
| 65 | 65 | 'DASHBOARD_GROUP_DATABASE' => 'Database', |
| 66 | 66 | |
| 67 | 67 | 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Installation file <a href="$install_path$/install.php" target="_blank">install.php</a> ' . |
| 68 | - 'still exists in the root of your site. It\'s necessary to remove it.', |
|
| 68 | + 'still exists in the root of your site. It\'s necessary to remove it.', |
|
| 69 | 69 | 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'It seems you have not yet edited site settings. ' . |
| 70 | - 'Go to <a href="$install_path$/admin/system/settings">settings page</a> to provide actual data.', |
|
| 70 | + 'Go to <a href="$install_path$/admin/system/settings">settings page</a> to provide actual data.', |
|
| 71 | 71 | |
| 72 | 72 | # Pages |
| 73 | 73 | |
@@ -64,9 +64,9 @@ |
||
| 64 | 64 | 'DASHBOARD_GROUP_GENERAL' => 'General', |
| 65 | 65 | 'DASHBOARD_GROUP_DATABASE' => 'Database', |
| 66 | 66 | |
| 67 | - 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Installation file <a href="$install_path$/install.php" target="_blank">install.php</a> ' . |
|
| 67 | + 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Installation file <a href="$install_path$/install.php" target="_blank">install.php</a> '. |
|
| 68 | 68 | 'still exists in the root of your site. It\'s necessary to remove it.', |
| 69 | - 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'It seems you have not yet edited site settings. ' . |
|
| 69 | + 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'It seems you have not yet edited site settings. '. |
|
| 70 | 70 | 'Go to <a href="$install_path$/admin/system/settings">settings page</a> to provide actual data.', |
| 71 | 71 | |
| 72 | 72 | # Pages |
@@ -34,7 +34,9 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function addParam(string $name, $default, callable $validator = null) : Dataset { |
| 36 | 36 | |
| 37 | - if ('' === $name) return $this; |
|
| 37 | + if ('' === $name) { |
|
| 38 | + return $this; |
|
| 39 | + } |
|
| 38 | 40 | |
| 39 | 41 | $this->data[$name] = $default; $this->defaults[$name] = $default; |
| 40 | 42 | |
@@ -53,7 +55,9 @@ discard block |
||
| 53 | 55 | |
| 54 | 56 | public function addParams(array $data) : Dataset { |
| 55 | 57 | |
| 56 | - foreach ($data as $name => $value) if (is_scalar($name)) $this->addParam($name, $value); |
|
| 58 | + foreach ($data as $name => $value) { |
|
| 59 | + if (is_scalar($name)) $this->addParam($name, $value); |
|
| 60 | + } |
|
| 57 | 61 | |
| 58 | 62 | return $this; |
| 59 | 63 | } |
@@ -66,16 +70,16 @@ discard block |
||
| 66 | 70 | |
| 67 | 71 | public function set(string $name, $value) { |
| 68 | 72 | |
| 69 | - if (!isset($this->validators[$name])) return null; |
|
| 73 | + if (!isset($this->validators[$name])) { |
|
| 74 | + return null; |
|
| 75 | + } |
|
| 70 | 76 | |
| 71 | 77 | try { |
| 72 | 78 | |
| 73 | - if (null === ($value = $this->validators[$name]($value))) return false; |
|
| 74 | - |
|
| 75 | - else { $this->data[$name] = $value; return true; } |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - catch (TypeError $e) { return false; } |
|
| 79 | + if (null === ($value = $this->validators[$name]($value))) { |
|
| 80 | + return false; |
|
| 81 | + } else { $this->data[$name] = $value; return true; } |
|
| 82 | + } catch (TypeError $e) { return false; } |
|
| 79 | 83 | } |
| 80 | 84 | |
| 81 | 85 | /** |
@@ -90,7 +94,9 @@ discard block |
||
| 90 | 94 | |
| 91 | 95 | foreach ($data as $name => $value) { |
| 92 | 96 | |
| 93 | - if (null !== ($value = $this->set($name, $value))) $setted[$name] = $value; |
|
| 97 | + if (null !== ($value = $this->set($name, $value))) { |
|
| 98 | + $setted[$name] = $value; |
|
| 99 | + } |
|
| 94 | 100 | } |
| 95 | 101 | |
| 96 | 102 | # ------------------------ |
@@ -106,16 +112,18 @@ discard block |
||
| 106 | 112 | |
| 107 | 113 | public function cast(string $name, $value) { |
| 108 | 114 | |
| 109 | - if (!isset($this->validators[$name])) return null; |
|
| 115 | + if (!isset($this->validators[$name])) { |
|
| 116 | + return null; |
|
| 117 | + } |
|
| 110 | 118 | |
| 111 | 119 | try { |
| 112 | 120 | |
| 113 | - if (null !== ($value = $this->validators[$name]($value))) return $value; |
|
| 114 | - |
|
| 115 | - else return $this->data[$name]; |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - catch (TypeError $e) { return $this->data[$name]; } |
|
| 121 | + if (null !== ($value = $this->validators[$name]($value))) { |
|
| 122 | + return $value; |
|
| 123 | + } else { |
|
| 124 | + return $this->data[$name]; |
|
| 125 | + } |
|
| 126 | + } catch (TypeError $e) { return $this->data[$name]; } |
|
| 119 | 127 | } |
| 120 | 128 | |
| 121 | 129 | /** |
@@ -130,7 +138,9 @@ discard block |
||
| 130 | 138 | |
| 131 | 139 | foreach ($data as $name => $value) { |
| 132 | 140 | |
| 133 | - if (null !== ($value = $this->cast($name, $value))) $casted[$name] = $value; |
|
| 141 | + if (null !== ($value = $this->cast($name, $value))) { |
|
| 142 | + $casted[$name] = $value; |
|
| 143 | + } |
|
| 134 | 144 | } |
| 135 | 145 | |
| 136 | 146 | # ------------------------ |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | # Handle request |
| 14 | 14 | |
| 15 | - if (Template::isBlock($result = $this->handle())) return $this->displayPage($result, STATUS_CODE_200); |
|
| 15 | + if (Template::isBlock($result = $this->handle())) { |
|
| 16 | + return $this->displayPage($result, STATUS_CODE_200); |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | # ------------------------ |
| 18 | 20 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
| 16 | 16 | |
| 17 | 17 | return (new Auth\Action\Login)->handle(); |
| 18 | 18 | } |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) { |
|
| 16 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | return (new Auth\Action\Login)->handle(); |
| 18 | 20 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
| 16 | 16 | |
| 17 | 17 | return (new Auth\Action\Login)->handle(); |
| 18 | 18 | } |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) { |
|
| 16 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | return (new Auth\Action\Login)->handle(); |
| 18 | 20 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function init() { |
| 14 | 14 | |
| 15 | - $this->config->addParam('active', '', function (bool $active) { |
|
| 15 | + $this->config->addParam('active', '', function(bool $active) { |
|
| 16 | 16 | |
| 17 | 17 | return ($active ? "ent.active = 1" : ''); |
| 18 | 18 | }); |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | |
| 31 | 31 | protected function processEntityParent(Template\Block $parent) { |
| 32 | 32 | |
| 33 | - if (0 !== $this->parent->id) $parent->getBlock('browse')->link = $this->parent->link; |
|
| 34 | - |
|
| 35 | - else { $parent->getBlock('browse')->disable(); $parent->getBlock('browse_disabled')->enable(); } |
|
| 33 | + if (0 !== $this->parent->id) { |
|
| 34 | + $parent->getBlock('browse')->link = $this->parent->link; |
|
| 35 | + } else { $parent->getBlock('browse')->disable(); $parent->getBlock('browse_disabled')->enable(); } |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | # Add item additional data |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | |
| 118 | 118 | $block = clone (self::$block ?? (self::$block = Template::createBlock( |
| 119 | 119 | |
| 120 | - '<$name${ for:attributes } $name$="$value$"{ / for:attributes }>' . |
|
| 120 | + '<$name${ for:attributes } $name$="$value$"{ / for:attributes }>'. |
|
| 121 | 121 | |
| 122 | 122 | '{ block:contents / }$contents${ ! block:closing }</$name$>{ / block:closing }' |
| 123 | 123 | ))); |
@@ -58,7 +58,9 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function setAttributes(array $attributes) : Tag { |
| 60 | 60 | |
| 61 | - foreach ($attributes as $name => $value) if (is_scalar($value)) $this->setAttribute($name, $value); |
|
| 61 | + foreach ($attributes as $name => $value) { |
|
| 62 | + if (is_scalar($value)) $this->setAttribute($name, $value); |
|
| 63 | + } |
|
| 62 | 64 | |
| 63 | 65 | return $this; |
| 64 | 66 | } |
@@ -71,7 +73,9 @@ discard block |
||
| 71 | 73 | |
| 72 | 74 | public function setContents($contents) : Tag { |
| 73 | 75 | |
| 74 | - if (Template::isBlock($contents) || is_scalar($contents) || is_null($contents)) $this->contents = $contents; |
|
| 76 | + if (Template::isBlock($contents) || is_scalar($contents) || is_null($contents)) { |
|
| 77 | + $this->contents = $contents; |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | return $this; |
| 77 | 81 | } |
@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function __clone() { |
| 30 | 30 | |
| 31 | - foreach ($this->items as $name => $item) $this->items[$name] = clone $item; |
|
| 31 | + foreach ($this->items as $name => $item) { |
|
| 32 | + $this->items[$name] = clone $item; |
|
| 33 | + } |
|
| 32 | 34 | } |
| 33 | 35 | |
| 34 | 36 | /** |
@@ -52,7 +54,9 @@ discard block |
||
| 52 | 54 | |
| 53 | 55 | public function addItems(array $items) : Group { |
| 54 | 56 | |
| 55 | - foreach ($items as $item) if ($item instanceof Block) $this->addItem($item); |
|
| 57 | + foreach ($items as $item) { |
|
| 58 | + if ($item instanceof Block) $this->addItem($item); |
|
| 59 | + } |
|
| 56 | 60 | |
| 57 | 61 | return $this; |
| 58 | 62 | } |
@@ -111,7 +115,9 @@ discard block |
||
| 111 | 115 | |
| 112 | 116 | # Process items |
| 113 | 117 | |
| 114 | - foreach ($this->items as $block) $contents .= $block->getContents(); |
|
| 118 | + foreach ($this->items as $block) { |
|
| 119 | + $contents .= $block->getContents(); |
|
| 120 | + } |
|
| 115 | 121 | |
| 116 | 122 | # ------------------------ |
| 117 | 123 | |