@@ -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 |
@@ -32,7 +32,6 @@ |
||
32 | 32 | * |
33 | 33 | * @access public |
34 | 34 | * |
35 | - * @param array $params |
|
36 | 35 | * |
37 | 36 | * @result void |
38 | 37 | */ |
@@ -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 | } |
@@ -82,6 +82,6 @@ |
||
82 | 82 | |
83 | 83 | $s->csrf = array_merge(is_array($s->csrf) ? $s->csrf : [], [md5($gen)]); |
84 | 84 | |
85 | - return $matches[1] . '<input type="hidden" name="csrf" value="' . $gen . '" />' . $matches[2] . $matches[3]; |
|
85 | + return $matches[1].'<input type="hidden" name="csrf" value="'.$gen.'" />'.$matches[2].$matches[3]; |
|
86 | 86 | } |
87 | 87 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | { |
26 | 26 | foreach ($this->elements AS $element) { |
27 | 27 | if (!$model->checkAttributeExists($element)) { |
28 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
28 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
29 | 29 | |
30 | 30 | return false; |
31 | 31 | } |
32 | 32 | if (!filter_var($model->$element, FILTER_VALIDATE_EMAIL)) { |
33 | - $this->errors[] = 'Parameter ' . $element . ' is not a valid E-mail address'; |
|
33 | + $this->errors[] = 'Parameter '.$element.' is not a valid E-mail address'; |
|
34 | 34 | |
35 | 35 | return false; |
36 | 36 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function client(IFormModel $model) |
46 | 46 | { |
47 | - $js = 'if (/^[\w.-]{1,}@[\w.-]{1,}$/.test(this.value) != true) {' . |
|
47 | + $js = 'if (/^[\w.-]{1,}@[\w.-]{1,}$/.test(this.value) != true) {'. |
|
48 | 48 | ' e.preventDefault(); this.focus(); alert(\'Value is not a valid e-mail\'); }'; |
49 | 49 | |
50 | 50 | return $js; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | return true; |
99 | 99 | } else { |
100 | - throw new Exception('Validator ' . $name . ' not defined.'); |
|
100 | + throw new Exception('Validator '.$name.' not defined.'); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | protected function getValidatorClass($name) |
126 | 126 | { |
127 | 127 | if (!empty(self::$validators[$name])) { |
128 | - return '\\Micro\\Validator\\' . self::$validators[$name]; |
|
128 | + return '\\Micro\\Validator\\'.self::$validators[$name]; |
|
129 | 129 | } elseif (class_exists($name) && is_subclass_of($name, '\Micro\Validator\IValidator')) { |
130 | 130 | return $name; |
131 | - } elseif (file_exists($this->container->kernel->getAppDir() . '/validator/' . $name . '.php')) { |
|
132 | - return '\\App\\Validator\\' . $name; |
|
131 | + } elseif (file_exists($this->container->kernel->getAppDir().'/validator/'.$name.'.php')) { |
|
132 | + return '\\App\\Validator\\'.$name; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return false; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | |
152 | 152 | $result = null; |
153 | 153 | foreach ($validator->elements AS $element) { |
154 | - $id = $object . '_' . $element; |
|
154 | + $id = $object.'_'.$element; |
|
155 | 155 | /** @noinspection PhpUndefinedMethodInspection */ |
156 | - $result .= 'jQuery("#' . $id . '").bind("change blur submit", function(e){ '; |
|
156 | + $result .= 'jQuery("#'.$id.'").bind("change blur submit", function(e){ '; |
|
157 | 157 | /** @noinspection DisconnectedForeachInstructionInspection */ |
158 | 158 | $result .= $validator->client($model); |
159 | 159 | $result .= ' });'; |