@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function add(Blueprint $table, $prefix = '') |
128 | 128 | { |
129 | 129 | // make all names to camel case |
130 | - $this->{'name'} = camel_case($prefix . $this->{'name'}); |
|
130 | + $this->{'name'} = camel_case($prefix.$this->{'name'}); |
|
131 | 131 | |
132 | 132 | if (method_exists($table, $this->{'dataType'}) === false) { |
133 | 133 | throw new Exceptions\InvalidColumnEntityException; |
@@ -158,6 +158,6 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function drop(Blueprint $table, $prefix = '') |
160 | 160 | { |
161 | - $table->dropColumn(camel_case($prefix . $this->{'name'})); |
|
161 | + $table->dropColumn(camel_case($prefix.$this->{'name'})); |
|
162 | 162 | } |
163 | 163 | } |
@@ -121,7 +121,7 @@ |
||
121 | 121 | |
122 | 122 | $this->group = $this->options['table']; |
123 | 123 | if (isset($this->options['id'])) { |
124 | - $this->group = $this->options['table'] . '_' . $this->options['id']; |
|
124 | + $this->group = $this->options['table'].'_'.$this->options['id']; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | if (isset($this->options['group'])) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | { |
129 | 129 | foreach ($this->register->get(self::FIELD_TYPE) as $id => $type) { |
130 | 130 | /** @var \Xpressengine\DynamicField\AbstractSkin $skin */ |
131 | - foreach ($this->register->get($id . PluginRegister::KEY_DELIMITER . self::FIELD_SKIN) as $skin) { |
|
131 | + foreach ($this->register->get($id.PluginRegister::KEY_DELIMITER.self::FIELD_SKIN) as $skin) { |
|
132 | 132 | yield $this->getType($handler, $skin::getId()); |
133 | 133 | } |
134 | 134 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function getSkinsByType(Handler $handler, $id) |
146 | 146 | { |
147 | 147 | /** @var \Xpressengine\DynamicField\AbstractSkin $skin */ |
148 | - foreach ($this->register->get($id . PluginRegister::KEY_DELIMITER . self::FIELD_SKIN) as $skin) { |
|
148 | + foreach ($this->register->get($id.PluginRegister::KEY_DELIMITER.self::FIELD_SKIN) as $skin) { |
|
149 | 149 | yield $this->getSkin($handler, $skin::getId()); |
150 | 150 | } |
151 | 151 | } |
@@ -258,14 +258,14 @@ discard block |
||
258 | 258 | $self = $this; |
259 | 259 | $this->handler->connection()->getSchemaBuilder()->create( |
260 | 260 | $this->handler->getConfigHandler()->getTableName($this->config), |
261 | - function (Blueprint $table) use ($column, $self) { |
|
261 | + function(Blueprint $table) use ($column, $self) { |
|
262 | 262 | $column->add($table, 'dynamic_field_target_'); |
263 | 263 | |
264 | 264 | /** |
265 | 265 | * @var ColumnEntity $addColumn |
266 | 266 | */ |
267 | 267 | foreach ($self->columns() as $addColumn) { |
268 | - $addColumn->add($table, $self->config->get('id') . '_'); |
|
268 | + $addColumn->add($table, $self->config->get('id').'_'); |
|
269 | 269 | } |
270 | 270 | $table->primary(array($column->name), 'primaryKey'); |
271 | 271 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | $this->handler->connection()->getSchemaBuilder()->create( |
288 | 288 | $this->handler->getConfigHandler()->getRevisionTableName($this->config), |
289 | - function (Blueprint $table) use ($column, $self) { |
|
289 | + function(Blueprint $table) use ($column, $self) { |
|
290 | 290 | $table->string('revisionId', 255); |
291 | 291 | $table->integer('revisionNo')->default(0); |
292 | 292 | |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | } |
332 | 332 | $this->handler->connection()->getSchemaBuilder()->table( |
333 | 333 | $tableName, |
334 | - function (Blueprint $table) use ($self) { |
|
334 | + function(Blueprint $table) use ($self) { |
|
335 | 335 | /** |
336 | 336 | * @var ColumnEntity $column |
337 | 337 | */ |
338 | 338 | foreach ($self->columns() as $column) { |
339 | - $column->add($table, $self->config->get('id') . '_'); |
|
339 | + $column->add($table, $self->config->get('id').'_'); |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | ); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | } |
369 | 369 | $this->handler->connection()->getSchemaBuilder()->table( |
370 | 370 | $tableName, |
371 | - function (Blueprint $table) use ($self) { |
|
371 | + function(Blueprint $table) use ($self) { |
|
372 | 372 | /** |
373 | 373 | * @var ColumnEntity $column |
374 | 374 | */ |
@@ -445,12 +445,12 @@ discard block |
||
445 | 445 | } |
446 | 446 | $this->handler->connection()->getSchemaBuilder()->table( |
447 | 447 | $tableName, |
448 | - function (Blueprint $table) use ($self) { |
|
448 | + function(Blueprint $table) use ($self) { |
|
449 | 449 | /** |
450 | 450 | * @var ColumnEntity $column |
451 | 451 | */ |
452 | 452 | foreach ($self->columns() as $column) { |
453 | - $column->drop($table, $self->config->get('id') . '_'); |
|
453 | + $column->drop($table, $self->config->get('id').'_'); |
|
454 | 454 | } |
455 | 455 | } |
456 | 456 | ); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | } |
469 | 469 | $this->handler->connection()->getSchemaBuilder()->table( |
470 | 470 | $tableName, |
471 | - function (Blueprint $table) use ($self) { |
|
471 | + function(Blueprint $table) use ($self) { |
|
472 | 472 | /** |
473 | 473 | * @var ColumnEntity $column |
474 | 474 | */ |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $insertParam = []; |
498 | 498 | $insertParam['dynamicFieldTargetId'] = $args[$config->get('joinColumnName')]; |
499 | 499 | foreach ($this->columns() as $column) { |
500 | - $key = camel_case($config->get('id') . '_' . $column->name); |
|
500 | + $key = camel_case($config->get('id').'_'.$column->name); |
|
501 | 501 | |
502 | 502 | if ($config->get('required') && (isset($args[$key]) === false || $args[$key] === '')) { |
503 | 503 | throw new Exceptions\RequiredParameterException(['name' => $key]); |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | $updateParam = []; |
561 | 561 | |
562 | 562 | foreach ($this->columns() as $column) { |
563 | - $key = camel_case($config->get('id') . '_' . $column->name); |
|
563 | + $key = camel_case($config->get('id').'_'.$column->name); |
|
564 | 564 | if ($config->get('required') && (isset($args[$key]) === true && $args[$key] === '')) { |
565 | 565 | throw new Exceptions\RequiredParameterException(['name' => $key]); |
566 | 566 | } |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | return $query; |
655 | 655 | } |
656 | 656 | |
657 | - $query->leftJoin($createTableName, function (JoinClause $join) use ($createTableName, $config, $baseTable) { |
|
657 | + $query->leftJoin($createTableName, function(JoinClause $join) use ($createTableName, $config, $baseTable) { |
|
658 | 658 | $join->on( |
659 | 659 | sprintf('%s.%s', $baseTable, $config->get('joinColumnName')), |
660 | 660 | '=', |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | { |
678 | 678 | $config = $this->config; |
679 | 679 | foreach ($this->columns() as $column) { |
680 | - $key = camel_case($config->get('id') . '_' . $column->name); |
|
680 | + $key = camel_case($config->get('id').'_'.$column->name); |
|
681 | 681 | |
682 | 682 | if (isset($params[$key]) && $params[$key] != '') { |
683 | 683 | $query = $query->where($key, '=', $params[$key]); |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | { |
699 | 699 | $config = $this->config; |
700 | 700 | foreach ($this->columns() as $column) { |
701 | - $key = camel_case($config->get('id') . '_' . $column->name); |
|
701 | + $key = camel_case($config->get('id').'_'.$column->name); |
|
702 | 702 | |
703 | 703 | if (isset($params[$key])) { |
704 | 704 | $query = $query->orderBy($key, '=', $params[$key]); |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | $insertParam['revisionId'] = $args['revisionId']; |
726 | 726 | $insertParam['revisionNo'] = $args['revisionNo']; |
727 | 727 | foreach ($this->columns() as $column) { |
728 | - $key = camel_case($this->config->get('id') . '_' . $column->name); |
|
728 | + $key = camel_case($this->config->get('id').'_'.$column->name); |
|
729 | 729 | |
730 | 730 | if ($this->config->get('required') && (isset($args[$key]) === false || $args[$key] === '')) { |
731 | 731 | throw new Exceptions\RequiredDynamicFieldException(['key' => $key]); |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | return $query; |
757 | 757 | } |
758 | 758 | |
759 | - $query->leftJoin($table, function (JoinClause $join) use ($tableName, $table, $config) { |
|
759 | + $query->leftJoin($table, function(JoinClause $join) use ($tableName, $table, $config) { |
|
760 | 760 | $join->on( |
761 | 761 | sprintf('%s.%s', $tableName, $config->get('joinColumnName')), |
762 | 762 | '=', |
@@ -101,7 +101,7 @@ |
||
101 | 101 | $config = $this->getConfig($file->disk); |
102 | 102 | |
103 | 103 | if (isset($config['url']) === true) { |
104 | - return rtrim($config['url'], '/') . '/' . ltrim($file->getPathname(), '/'); |
|
104 | + return rtrim($config['url'], '/').'/'.ltrim($file->getPathname(), '/'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | return null; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $module = $instanceRoute->module; |
49 | 49 | } |
50 | 50 | |
51 | - $name = $module . '.' . $name; |
|
51 | + $name = $module.'.'.$name; |
|
52 | 52 | |
53 | 53 | array_unshift($parameters, $url); |
54 | 54 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | if (isset($action['as'])) { |
57 | 57 | if (isset($action['module'])) { |
58 | - $this->nameList[$action['module'] . "." . $action['as']] = $route; |
|
58 | + $this->nameList[$action['module'].".".$action['as']] = $route; |
|
59 | 59 | } else { |
60 | 60 | $this->nameList[$action['as']] = $route; |
61 | 61 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | $key = $this->getCacheKey('all'); |
73 | 73 | |
74 | - $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function () use ($key) { |
|
74 | + $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function() use ($key) { |
|
75 | 75 | $routes = $this->repo->all(); |
76 | 76 | if (count($routes) > 1) { |
77 | 77 | $this->cache->put($key, $routes); |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function findByUrlAndSiteKey($url, $siteKey) |
94 | 94 | { |
95 | - $key = $this->getCacheKey($siteKey . '_' . $url); |
|
95 | + $key = $this->getCacheKey($siteKey.'_'.$url); |
|
96 | 96 | |
97 | - $route = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function () use ($url, $siteKey) { |
|
97 | + $route = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function() use ($url, $siteKey) { |
|
98 | 98 | if ($route = $this->repo->findByUrlAndSiteKey($url, $siteKey)) { |
99 | 99 | $this->cachingItem($route); |
100 | 100 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | protected function cachingItem(InstanceRoute $route) |
115 | 115 | { |
116 | - $this->cache->put($this->getCacheKey($route->siteKey . '_' . $route->url), $route); |
|
116 | + $this->cache->put($this->getCacheKey($route->siteKey.'_'.$route->url), $route); |
|
117 | 117 | $this->cache->put($this->getCacheKey($route->instanceId), $route); |
118 | 118 | } |
119 | 119 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | $key = $this->getCacheKey($instanceId); |
129 | 129 | |
130 | - $route = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function () use ($instanceId) { |
|
130 | + $route = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function() use ($instanceId) { |
|
131 | 131 | if ($route = $this->repo->findByInstanceId($instanceId)) { |
132 | 132 | $this->cachingItem($route); |
133 | 133 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | { |
149 | 149 | $key = $this->getCacheKey($siteKey); |
150 | 150 | |
151 | - $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function () use ($siteKey, $key) { |
|
151 | + $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function() use ($siteKey, $key) { |
|
152 | 152 | $routes = $this->repo->fetchBySiteKey($siteKey); |
153 | 153 | if (count($routes) > 0) { |
154 | 154 | $this->cache->put($key, $routes); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | $key = $this->getCacheKey($module); |
172 | 172 | |
173 | - $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function () use ($module, $key) { |
|
173 | + $routes = $this->cache->has($key) ? $this->cache->get($key) : call_user_func(function() use ($module, $key) { |
|
174 | 174 | $routes = $this->repo->fetchByModule($module); |
175 | 175 | if (count($routes) > 0) { |
176 | 176 | $this->cache->put($key, $routes); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function delete(InstanceRoute $route) |
220 | 220 | { |
221 | - $this->cache->forget($this->getCacheKey($route->siteKey . '_' . $route->url)); |
|
221 | + $this->cache->forget($this->getCacheKey($route->siteKey.'_'.$route->url)); |
|
222 | 222 | $this->cache->forget($this->getCacheKey($route->instanceId)); |
223 | 223 | |
224 | 224 | return $this->repo->delete($route); |
@@ -232,6 +232,6 @@ discard block |
||
232 | 232 | */ |
233 | 233 | protected function getCacheKey($keyword) |
234 | 234 | { |
235 | - return $this->prefix . '@' . $keyword; |
|
235 | + return $this->prefix.'@'.$keyword; |
|
236 | 236 | } |
237 | 237 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | * @param ConfigEntity $config config instance |
377 | 377 | * @return void |
378 | 378 | */ |
379 | - protected function bindClosure(ConfigEntity &$config) |
|
379 | + protected function bindClosure(ConfigEntity & $config) |
|
380 | 380 | { |
381 | 381 | if (isset($this->closures[$config->siteKey]) |
382 | 382 | && isset($this->closures[$config->siteKey][$config->name])) { |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | */ |
535 | 535 | private function sort(array $configs, $flag = 'asc') |
536 | 536 | { |
537 | - uasort($configs, function (ConfigEntity $front, ConfigEntity $rear) use ($flag) { |
|
537 | + uasort($configs, function(ConfigEntity $front, ConfigEntity $rear) use ($flag) { |
|
538 | 538 | $frontLevel = $front->getDepth(); |
539 | 539 | $rearLevel = $rear->getDepth(); |
540 | 540 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | $arrName = explode('.', $config->name); |
583 | 583 | $key = array_pop($arrName); |
584 | 584 | if ($to !== null) { |
585 | - $key = $to . '.' . $key; |
|
585 | + $key = $to.'.'.$key; |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | return $this->get($key, false, $config->siteKey); |