@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | break; |
68 | 68 | |
69 | 69 | default: |
70 | - throw new Exception('Service type `' . $type . '` wrong name.'); |
|
70 | + throw new Exception('Service type `'.$type.'` wrong name.'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $broker->{$type}($route, $data); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | if (!$server) { |
102 | - throw new Exception('Message not send, random servers is down into `' . $uri . '`'); |
|
102 | + throw new Exception('Message not send, random servers is down into `'.$uri.'`'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | return $this->brokers[$server]; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $servers += $route['*']; |
134 | 134 | } |
135 | 135 | if (!$servers) { |
136 | - throw new Exception('Type `' . $type . '` not found into route'); |
|
136 | + throw new Exception('Type `'.$type.'` not found into route'); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $servers; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $keys = array_keys($this->routes); |
155 | 155 | |
156 | 156 | foreach (range(0, count($keys) - 1) AS $i) { |
157 | - if (preg_match('/' . $keys[$i] . '/', $uri)) { |
|
157 | + if (preg_match('/'.$keys[$i].'/', $uri)) { |
|
158 | 158 | if (!is_array($this->routes[$keys[$i]])) { |
159 | 159 | $this->routes[$keys[$i]] = ['*' => $this->routes[$keys[$i]]]; |
160 | 160 | } |
@@ -162,6 +162,6 @@ discard block |
||
162 | 162 | return $this->routes[$keys[$i]]; |
163 | 163 | } |
164 | 164 | } |
165 | - throw new Exception('Route `' . $uri . '` not found'); |
|
165 | + throw new Exception('Route `'.$uri.'` not found'); |
|
166 | 166 | } |
167 | 167 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | $path = dirname( |
34 | 34 | str_replace(['\\', 'App'], ['/', $container->kernel->getAppDir()], get_called_class()) |
35 | - ) . '/config.php'; |
|
35 | + ).'/config.php'; |
|
36 | 36 | |
37 | 37 | if (file_exists($path)) { |
38 | 38 | $container->load($path); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | // if module defined |
48 | 48 | if ($modules) { |
49 | - $className = '\\App' . $modules . '\\' . ucfirst(basename(str_replace('\\', '/', $modules))) . 'Module'; |
|
49 | + $className = '\\App'.$modules.'\\'.ucfirst(basename(str_replace('\\', '/', $modules))).'Module'; |
|
50 | 50 | |
51 | 51 | if (class_exists($className) && is_subclass_of($className, '\Micro\Mvc\Module')) { |
52 | 52 | $this->module = new $className($this->container); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $actionClass = false; |
51 | 51 | |
52 | 52 | // check action exists |
53 | - if (!method_exists($this, 'action' . ucfirst($name)) && !$actionClass = $this->getActionClassByName($name)) { |
|
54 | - $this->response->setStatus(500, 'Action "' . $name . '" not found into ' . get_class($this)); |
|
53 | + if (!method_exists($this, 'action'.ucfirst($name)) && !$actionClass = $this->getActionClassByName($name)) { |
|
54 | + $this->response->setStatus(500, 'Action "'.$name.'" not found into '.get_class($this)); |
|
55 | 55 | |
56 | 56 | return $this->response; |
57 | 57 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | if (!empty($types[$name]) && $this->methodType !== $types[$name]) { |
62 | 62 | $this->response->setStatus(500, |
63 | - 'Action "' . $name . '" not run with method "' . $this->methodType . '" into ' . get_class($this) |
|
63 | + 'Action "'.$name.'" not run with method "'.$this->methodType.'" into '.get_class($this) |
|
64 | 64 | ); |
65 | 65 | |
66 | 66 | return $this->response; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $cl = new $actionClass($this->container); |
77 | 77 | $view = $cl->run(); |
78 | 78 | } else { |
79 | - $view = $this->{'action' . ucfirst($name)}(); |
|
79 | + $view = $this->{'action'.ucfirst($name)}(); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($this->response->getContentType() !== $this->format) { |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | $view = null; |
41 | 41 | $actionClass = false; |
42 | 42 | |
43 | - if (!method_exists($this, 'action' . ucfirst($name))) { |
|
43 | + if (!method_exists($this, 'action'.ucfirst($name))) { |
|
44 | 44 | $actionClass = $this->getActionClassByName($name); |
45 | 45 | if (!$actionClass) { |
46 | - throw new Exception('Action "' . $name . '" not found into ' . get_class($this)); |
|
46 | + throw new Exception('Action "'.$name.'" not found into '.get_class($this)); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $cl = new $actionClass($this->container); |
60 | 60 | $view = $cl->run(); |
61 | 61 | } else { |
62 | - $view = $this->{'action' . ucfirst($name)}(); |
|
62 | + $view = $this->{'action'.ucfirst($name)}(); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (is_object($view)) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function widget($name, array $options = [], $capture = false) |
58 | 58 | { |
59 | 59 | if (!class_exists($name)) { |
60 | - throw new Exception('Widget ' . $name . ' not found.'); |
|
60 | + throw new Exception('Widget '.$name.' not found.'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $options = array_merge($options, ['container' => $this->container]); |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | public function beginWidget($name, array $options = []) |
99 | 99 | { |
100 | 100 | if (!class_exists($name)) { |
101 | - throw new Exception('Widget ' . $name . ' not found.'); |
|
101 | + throw new Exception('Widget '.$name.' not found.'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if (!empty($GLOBALS['widgetStack'][$name])) { |
105 | - throw new Exception('This widget (' . $name . ') already started!'); |
|
105 | + throw new Exception('This widget ('.$name.') already started!'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $options = array_merge($options, ['container' => $this->container]); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | if (!class_exists($name) || empty($GLOBALS['widgetStack'][$name])) { |
139 | - throw new Exception('Widget ' . $name . ' not started.'); |
|
139 | + throw new Exception('Widget '.$name.' not started.'); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** @var \Micro\mvc\Widget $widget widget */ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ($this->layout && (!$layoutPath = $this->getLayoutFile($this->container->kernel->getAppDir(), |
91 | 91 | $this->module)) |
92 | 92 | ) { |
93 | - $this->container->logger->send('error', 'Layout `' . $this->layout . '` not found'); |
|
93 | + $this->container->logger->send('error', 'Layout `'.$this->layout.'` not found'); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($layoutPath) { |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | $module = substr($module, 0, strrpos($module, '/')); |
120 | 120 | } |
121 | 121 | |
122 | - $layout = $appDir . '/' . ($module ? $module . '/' : $module); |
|
123 | - $afterPath = 'views/layouts/' . ucfirst($this->layout) . '.php'; |
|
122 | + $layout = $appDir.'/'.($module ? $module.'/' : $module); |
|
123 | + $afterPath = 'views/layouts/'.ucfirst($this->layout).'.php'; |
|
124 | 124 | |
125 | - if (file_exists($layout . $afterPath)) { |
|
126 | - return $layout . $afterPath; |
|
125 | + if (file_exists($layout.$afterPath)) { |
|
126 | + return $layout.$afterPath; |
|
127 | 127 | } |
128 | 128 | |
129 | - if (file_exists($appDir . '/' . $afterPath)) { |
|
130 | - return $appDir . '/' . $afterPath; |
|
129 | + if (file_exists($appDir.'/'.$afterPath)) { |
|
130 | + return $appDir.'/'.$afterPath; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | return false; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | include str_replace('\\', '/', $fileName); |
157 | 157 | |
158 | 158 | if (!empty($GLOBALS['widgetStack'])) { |
159 | - throw new Exception(count($GLOBALS['widgetStack']) . ' widgets not endings.'); |
|
159 | + throw new Exception(count($GLOBALS['widgetStack']).' widgets not endings.'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | return ob_get_clean(); |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | $cl = substr($cl, strpos($cl, '/')); |
188 | 188 | |
189 | 189 | if ($this->asWidget) { |
190 | - $path .= $cl . '/views/' . $view . '.php'; |
|
190 | + $path .= $cl.'/views/'.$view.'.php'; |
|
191 | 191 | } else { |
192 | 192 | $className = str_replace('controller', '', |
193 | - strtolower(basename(str_replace('\\', '/', '/' . $this->path)))); |
|
194 | - $path .= dirname($cl) . '/views/' . $className . '/' . $view . '.php'; |
|
193 | + strtolower(basename(str_replace('\\', '/', '/'.$this->path)))); |
|
194 | + $path .= dirname($cl).'/views/'.$className.'/'.$view.'.php'; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | $path = str_replace('//', '/', $path); |
198 | 198 | |
199 | 199 | if (!file_exists($path)) { |
200 | - throw new Exception('View path `' . $path . '` not exists.'); |
|
200 | + throw new Exception('View path `'.$path.'` not exists.'); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return $path; |
@@ -79,9 +79,9 @@ |
||
79 | 79 | $result = []; |
80 | 80 | |
81 | 81 | foreach ($this->buttons AS $key => $row) { |
82 | - $result['{' . $key . '}'] = Html::href( |
|
82 | + $result['{'.$key.'}'] = Html::href( |
|
83 | 83 | !empty($row['text']) ? $row['text'] : $key, |
84 | - $this->params['link'] . (!empty($row['link']) ? $row['link'] : '/') . $this->params['pKey'], |
|
84 | + $this->params['link'].(!empty($row['link']) ? $row['link'] : '/').$this->params['pKey'], |
|
85 | 85 | !empty($row['attributes']) ? $row['attributes'] : [] |
86 | 86 | ); |
87 | 87 | } |
@@ -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 | } |