@@ -155,7 +155,7 @@ |
||
155 | 155 | */ |
156 | 156 | public function defaultMapOptions() |
157 | 157 | { |
158 | - return [ 'api_key' => $this->apiKey() ]; |
|
158 | + return ['api_key' => $this->apiKey()]; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | public function addFeedbackFromValidation(ModelInterface $obj, $filters = null) |
60 | 60 | { |
61 | 61 | $validator = $obj->validator(); |
62 | - $levels = [ ModelValidator::ERROR, ModelValidator::WARNING, ModelValidator::NOTICE ]; |
|
62 | + $levels = [ModelValidator::ERROR, ModelValidator::WARNING, ModelValidator::NOTICE]; |
|
63 | 63 | |
64 | 64 | if (is_string($filters) && in_array($filters, $levels)) { |
65 | - $results = call_user_func([ $validator, $filters.'Results' ]); |
|
65 | + $results = call_user_func([$validator, $filters.'Results']); |
|
66 | 66 | foreach ($results as $result) { |
67 | 67 | $this->addFeedback($result->level(), $result->message()); |
68 | 68 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function results() |
95 | 95 | { |
96 | - $results = [ |
|
96 | + $results = [ |
|
97 | 97 | 'success' => $this->success(), |
98 | 98 | 'obj_id' => null, |
99 | 99 | 'obj' => null, |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $i = 0; |
133 | 133 | $t = count($array[$index]); |
134 | 134 | |
135 | - for (; $i<$t; $i++) { |
|
135 | + for (; $i < $t; $i++) { |
|
136 | 136 | $orig = $array[$index][$i]; |
137 | 137 | if (!isset($translations[$orig])) { |
138 | 138 | $translations[$orig] = [ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $max = $this->maxRecursiveLevel(); |
163 | 163 | $i = 1; |
164 | 164 | $files = glob($pattern, $flags); |
165 | - foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR|GLOB_NOSORT)) as $dir) { |
|
165 | + foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR | GLOB_NOSORT)) as $dir) { |
|
166 | 166 | $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flags)); |
167 | 167 | $i++; |
168 | 168 | if ($i >= $max) { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | fputcsv($file, $columns, $separator, $enclosure); |
301 | 301 | |
302 | 302 | foreach ($translations as $orig => $translation) { |
303 | - $data = [ $orig, $translation['translation'], $translation['context'] ]; |
|
303 | + $data = [$orig, $translation['translation'], $translation['context']]; |
|
304 | 304 | fputcsv($file, $data, $separator, $enclosure); |
305 | 305 | } |
306 | 306 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $orig = $this->origLanguage(); |
404 | 404 | $opposites = $this->oppositeLanguages(); |
405 | 405 | |
406 | - $columns = [ $orig ]; |
|
406 | + $columns = [$orig]; |
|
407 | 407 | |
408 | 408 | foreach ($opposites as $lang) { |
409 | 409 | $columns[] = $lang; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | if ($token->source()->tableExists()) { |
45 | 45 | $table = $token->source()->table(); |
46 | 46 | $q = 'DELETE FROM '.$table.' WHERE username = :username'; |
47 | - $token->source()->dbQuery($q, [ 'username' => $user->username() ]); |
|
47 | + $token->source()->dbQuery($q, ['username' => $user->username()]); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return $this; |
@@ -309,7 +309,7 @@ |
||
309 | 309 | 'end_date' => $this->endDate()->format($this->dateFormat()) |
310 | 310 | ]); |
311 | 311 | |
312 | - $this->dbRows = $result->fetchAll((PDO::FETCH_GROUP|PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC)); |
|
312 | + $this->dbRows = $result->fetchAll((PDO::FETCH_GROUP | PDO::FETCH_UNIQUE | PDO::FETCH_ASSOC)); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | return $this->dbRows; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | // Can be override from the outside. |
237 | 237 | if (!$this->exportIdent()) { |
238 | - $exportIdent = $this->exportIdent() ? : $this->metadata()->get('admin.default_export'); |
|
238 | + $exportIdent = $this->exportIdent() ?: $this->metadata()->get('admin.default_export'); |
|
239 | 239 | if (!$exportIdent) { |
240 | 240 | throw new Exception(sprintf( |
241 | 241 | 'No export ident defined for "%s" in %s', |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | */ |
560 | 560 | private function brToNewline($text) |
561 | 561 | { |
562 | - $breaks = [ '<br />', '<br>', '<br/>' ]; |
|
562 | + $breaks = ['<br />', '<br>', '<br/>']; |
|
563 | 563 | $text = str_ireplace($breaks, "\r\n", $text); |
564 | 564 | return $text; |
565 | 565 | } |
@@ -123,7 +123,7 @@ |
||
123 | 123 | continue; |
124 | 124 | } |
125 | 125 | |
126 | - $objForm = [ 'id' => $obj->id() ]; |
|
126 | + $objForm = ['id' => $obj->id()]; |
|
127 | 127 | |
128 | 128 | $form = $this->widgetFactory()->create(ObjectFormWidget::class); |
129 | 129 | $form->set_objType($objType); |
@@ -150,7 +150,7 @@ |
||
150 | 150 | $prop = $formGroup->storageProperty(); |
151 | 151 | $val = $formGroup->obj()->propertyValue($prop->ident()); |
152 | 152 | |
153 | - $this->obj = $prop->structureVal($val, [ 'default_data' => true ]); |
|
153 | + $this->obj = $prop->structureVal($val, ['default_data' => true]); |
|
154 | 154 | if ($this->obj === null) { |
155 | 155 | $this->obj = clone $prop->structureProto(); |
156 | 156 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | if ($obj instanceof ViewableInterface && $obj->view()) { |
285 | 285 | $data = $obj->view()->render($data, $obj->viewController()); |
286 | 286 | } else { |
287 | - $data = preg_replace_callback('~\{\{\s*(.*?)\s*\}\}~i', [ $this, 'parseDataToken' ], $data); |
|
287 | + $data = preg_replace_callback('~\{\{\s*(.*?)\s*\}\}~i', [$this, 'parseDataToken'], $data); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | return $data; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | $token = trim($token); |
309 | - $method = [ $this, $token ]; |
|
309 | + $method = [$this, $token]; |
|
310 | 310 | |
311 | 311 | if (is_callable($method)) { |
312 | 312 | $value = call_user_func($method); |