@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if ($args['data']->having || $args['data']->group) { |
| 101 | 101 | $res = new Query($this->container->db); |
| 102 | 102 | $res->select = 'COUNT(*)'; |
| 103 | - $res->table = '(' . $args['data']->getQuery() . ') micro_count'; |
|
| 103 | + $res->table = '('.$args['data']->getQuery().') micro_count'; |
|
| 104 | 104 | $res->single = true; |
| 105 | 105 | } else { |
| 106 | 106 | /** @var Query $res */ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function init() |
| 138 | 138 | { |
| 139 | - $this->filterPrefix = ucfirst($this->filterPrefix ?: 'data' . $this->totalCount); |
|
| 139 | + $this->filterPrefix = ucfirst($this->filterPrefix ?: 'data'.$this->totalCount); |
|
| 140 | 140 | $this->fields = (null !== $this->rows) ? array_keys(Type::getVars($this->rows[0])) : []; |
| 141 | 141 | $this->rowsCount = count($this->rows); |
| 142 | 142 | $this->paginationConfig['countRows'] = $this->totalCount; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function run() |
| 166 | 166 | { |
| 167 | 167 | if (!$this->rows) { |
| 168 | - return Html::openTag('div', $this->attributesEmpty) . $this->emptyText . Html::closeTag('div'); |
|
| 168 | + return Html::openTag('div', $this->attributesEmpty).$this->emptyText.Html::closeTag('div'); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | ob_start(); |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | protected function getCounter() |
| 189 | 189 | { |
| 190 | - return Html::openTag('div', $this->attributesCounter) . |
|
| 191 | - $this->counterText . $this->totalCount . Html::closeTag('div'); |
|
| 190 | + return Html::openTag('div', $this->attributesCounter). |
|
| 191 | + $this->counterText.$this->totalCount.Html::closeTag('div'); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $this->templateTable |
| 226 | 226 | ); |
| 227 | 227 | |
| 228 | - return Html::openTag('table', $this->attributes) . $table . Html::closeTag('table'); |
|
| 228 | + return Html::openTag('table', $this->attributes).$table.Html::closeTag('table'); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $result .= Html::closeTag('th'); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - return $result . Html::closeTag('tr'); |
|
| 255 | + return $result.Html::closeTag('tr'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -282,15 +282,15 @@ discard block |
||
| 282 | 282 | $result .= $row['filter']; |
| 283 | 283 | } else { |
| 284 | 284 | $buffer = is_array($row) ? $key : $row; |
| 285 | - $fieldName = $this->filterPrefix . '[' . $buffer . ']'; |
|
| 286 | - $fieldId = $this->filterPrefix . '_' . $buffer; |
|
| 285 | + $fieldName = $this->filterPrefix.'['.$buffer.']'; |
|
| 286 | + $fieldId = $this->filterPrefix.'_'.$buffer; |
|
| 287 | 287 | $val = !empty($filtersData[$buffer]) ? $filtersData[$buffer] : ''; |
| 288 | 288 | $result .= Html::textField($fieldName, $val, ['id' => $fieldId]); |
| 289 | 289 | } |
| 290 | 290 | $result .= Html::closeTag('td'); |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - return $result . Html::closeTag('tr') . Html::endForm(); |
|
| 293 | + return $result.Html::closeTag('tr').Html::endForm(); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | $result = null; |
| 306 | 306 | |
| 307 | 307 | if (0 === count($this->rows)) { |
| 308 | - return Html::openTag('tr') . |
|
| 309 | - Html::openTag('td', ['cols' => count($this->fields)]) . $this->emptyText . Html::closeTag('td') . |
|
| 308 | + return Html::openTag('tr'). |
|
| 309 | + Html::openTag('td', ['cols' => count($this->fields)]).$this->emptyText.Html::closeTag('td'). |
|
| 310 | 310 | Html::closeTag('tr'); |
| 311 | 311 | } |
| 312 | 312 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | $row + ['str' => (null === $data) ?: $data, 'pKey' => $primaryKey] |
| 323 | 323 | )); |
| 324 | 324 | } elseif (!empty($row['value'])) { |
| 325 | - $result .= eval('return ' . $row['value'] . ';'); |
|
| 325 | + $result .= eval('return '.$row['value'].';'); |
|
| 326 | 326 | } else { |
| 327 | 327 | $result .= property_exists($data, $key) ? $data->$key : null; |
| 328 | 328 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | /** @noinspection OnlyWritesOnParameterInspection */ |
| 151 | 151 | /** @noinspection PhpUnusedLocalVariableInspection */ |
| 152 | 152 | $data = $this->data; // for eval |
| 153 | - $buffer .= eval('return ' . $val['value']); |
|
| 153 | + $buffer .= eval('return '.$val['value']); |
|
| 154 | 154 | break; |
| 155 | 155 | |
| 156 | 156 | default: |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - $result .= (strlen($buffer) ? $buffer : ' ') . Html::closeTag('dd'); |
|
| 164 | + $result .= (strlen($buffer) ? $buffer : ' ').Html::closeTag('dd'); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | echo $result, Html::closeTag('dl'); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | public function init() |
| 128 | 128 | { |
| 129 | 129 | if (!file_exists($this->pathView)) { |
| 130 | - throw new Exception('View path not valid: ' . $this->pathView); |
|
| 130 | + throw new Exception('View path not valid: '.$this->pathView); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $this->rowsCount = count($this->rows); |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | protected function getCounter() |
| 164 | 164 | { |
| 165 | - return Html::openTag('div', $this->attributesCounter) . |
|
| 166 | - $this->counterText . $this->totalCount . Html::closeTag('div'); |
|
| 165 | + return Html::openTag('div', $this->attributesCounter). |
|
| 166 | + $this->counterText.$this->totalCount.Html::closeTag('div'); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | protected function getElements() |
| 177 | 177 | { |
| 178 | 178 | if (!$this->rows) { |
| 179 | - return Html::openTag('div', $this->attributesEmpty) . $this->emptyText . Html::closeTag('div'); |
|
| 179 | + return Html::openTag('div', $this->attributesEmpty).$this->emptyText.Html::closeTag('div'); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | ob_start(); |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | if ($this->totalPages > 0) { |
| 91 | 91 | for ($i = 1; $i <= $this->totalPages; $i++) { |
| 92 | 92 | $items[] = [ |
| 93 | - 'text' => Html::href($i, $this->url . ($i - 1), $this->attributesLink), |
|
| 93 | + 'text' => Html::href($i, $this->url.($i - 1), $this->attributesLink), |
|
| 94 | 94 | 'attr' => array_merge( |
| 95 | 95 | $this->attributesElement, |
| 96 | 96 | ($i === (int)$this->currentPage + 1 ? ['class' => 'active'] : []) |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | $query = new Query($this->container->db); |
| 95 | 95 | $query->select = '*'; |
| 96 | 96 | $query->table = 'acl_user'; |
| 97 | - $query->addWhere('`user`=' . $userId); |
|
| 97 | + $query->addWhere('`user`='.$userId); |
|
| 98 | 98 | $query->single = false; |
| 99 | 99 | |
| 100 | 100 | return $query->run(); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $query->distinct = true; |
| 151 | 151 | $query->select = '`role` AS `name`'; |
| 152 | 152 | $query->table = '`rbac_user`'; |
| 153 | - $query->addWhere('`user`=' . $userId); |
|
| 153 | + $query->addWhere('`user`='.$userId); |
|
| 154 | 154 | $query->single = false; |
| 155 | 155 | |
| 156 | 156 | return $query->run(\PDO::FETCH_ASSOC); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } else { |
| 202 | 202 | extract($data, EXTR_OVERWRITE); |
| 203 | 203 | |
| 204 | - return eval('return ' . $role['data']); |
|
| 204 | + return eval('return '.$role['data']); |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $query->addJoin('`acl_role_perm` AS `arp`', '`arp`.`role` = `au`.`role`'); |
| 81 | 81 | $query->addJoin('`acl_perm` AS `ap1`', '`ap1`.`id` = `arp`.`perm`'); |
| 82 | 82 | |
| 83 | - $query->addWhere('`au`.`user`=' . $userId); |
|
| 83 | + $query->addWhere('`au`.`user`='.$userId); |
|
| 84 | 84 | $query->addWhere('`ap`.`name`=:perm OR `ap1`.`name`=:perm'); |
| 85 | 85 | |
| 86 | 86 | $query->limit = 1; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $query = new Query($this->container->db); |
| 171 | 171 | $query->select = '*'; |
| 172 | 172 | $query->table = 'acl_role_perm'; |
| 173 | - $query->addWhere('role=' . $role); |
|
| 173 | + $query->addWhere('role='.$role); |
|
| 174 | 174 | $query->single = false; |
| 175 | 175 | |
| 176 | 176 | return $query->run(); |
@@ -238,9 +238,9 @@ discard block |
||
| 238 | 238 | public function forbidPrivilege($userId, $privilege = null, $asRole = true) |
| 239 | 239 | { |
| 240 | 240 | if ($asRole) { |
| 241 | - $this->container->db->delete('acl_user', '`user`="' . $userId . '" AND `role`="' . $privilege . '"'); |
|
| 241 | + $this->container->db->delete('acl_user', '`user`="'.$userId.'" AND `role`="'.$privilege.'"'); |
|
| 242 | 242 | } else { |
| 243 | - $this->container->db->delete('acl_user', '`user`="' . $userId . '" AND `perm`="' . $privilege . '"'); |
|
| 243 | + $this->container->db->delete('acl_user', '`user`="'.$userId.'" AND `perm`="'.$privilege.'"'); |
|
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $this->from = !empty($params['from']) ? $params['from'] : getenv('SERVER_ADMIN'); |
| 41 | 41 | $this->to = !empty($params['to']) ? $params['to'] : $this->from; |
| 42 | - $this->subject = $params['subject'] ?: getenv('SERVER_NAME') . ' log message'; |
|
| 42 | + $this->subject = $params['subject'] ?: getenv('SERVER_NAME').' log message'; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $mail = new Message($this->from); |
| 51 | 51 | |
| 52 | 52 | $mail->setTo($this->to); |
| 53 | - $mail->setText(ucfirst($level) . ': ' . $message, $this->type); |
|
| 53 | + $mail->setText(ucfirst($level).': '.$message, $this->type); |
|
| 54 | 54 | |
| 55 | 55 | $this->container->mail->send($mail); |
| 56 | 56 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | if (is_writable($params['filename']) || is_writable(dirname($params['filename']))) { |
| 44 | 44 | $this->connect = fopen($params['filename'], 'a+'); |
| 45 | 45 | } else { |
| 46 | - throw new Exception('Directory or file "' . $params['filename'] . '" is read-only'); |
|
| 46 | + throw new Exception('Directory or file "'.$params['filename'].'" is read-only'); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function sendMessage($level, $message) |
| 54 | 54 | { |
| 55 | 55 | if (is_resource($this->connect)) { |
| 56 | - fwrite($this->connect, '[' . date('H:i:s d.m.Y') . '] ' . ucfirst($level) . ": {$message}\n"); |
|
| 56 | + fwrite($this->connect, '['.date('H:i:s d.m.Y').'] '.ucfirst($level).": {$message}\n"); |
|
| 57 | 57 | } else { |
| 58 | 58 | throw new Exception('Error write log in file.'); |
| 59 | 59 | } |