@@ -70,17 +70,17 @@ |
||
70 | 70 | */ |
71 | 71 | function bytes($bytes, $unit = null, $dec = 2) |
72 | 72 | { |
73 | - $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
|
73 | + $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
|
74 | 74 | if (in_array($unit, $size)) { |
75 | 75 | $factor = array_search($unit, $size); |
76 | 76 | } else { |
77 | - $factor = (int)((strlen($bytes) - 1) / 3); |
|
77 | + $factor = (int) ((strlen($bytes) - 1) / 3); |
|
78 | 78 | } |
79 | 79 | $dec = $factor == 0 ? 0 : $dec; |
80 | 80 | if ($factor >= count($size)) { |
81 | 81 | $factor = count($size) - 1; |
82 | 82 | } |
83 | 83 | |
84 | - return sprintf("%.{$dec}f", $bytes / pow(1024, $factor)) . $size[$factor]; |
|
84 | + return sprintf("%.{$dec}f", $bytes / pow(1024, $factor)).$size[$factor]; |
|
85 | 85 | } |
86 | 86 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | // prepend ":" to each key |
94 | 94 | $keys = array_map( |
95 | - function ($key) { |
|
95 | + function($key) { |
|
96 | 96 | return ':'.$key; |
97 | 97 | }, |
98 | 98 | array_keys($this->args) |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | |
445 | 445 | /** @var Collection $children */ |
446 | - $children = $children->filter(function (MenuItem $model) use ($item) { |
|
446 | + $children = $children->filter(function(MenuItem $model) use ($item) { |
|
447 | 447 | return $model->getKey() != $item->getKey(); |
448 | 448 | }); |
449 | 449 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | ->merge([$item]) |
452 | 452 | ->merge($children->slice($position)); |
453 | 453 | |
454 | - $children->each(function (MenuItem $model, $idx) { |
|
454 | + $children->each(function(MenuItem $model, $idx) { |
|
455 | 455 | $model->{$model->getOrderKeyName()} = $idx; |
456 | 456 | $model->save(); |
457 | 457 | }); |
@@ -511,12 +511,12 @@ discard block |
||
511 | 511 | $ancestor = $item->getAncestorName(); |
512 | 512 | $descendant = $item->getDescendantName(); |
513 | 513 | |
514 | - $rows = $conn->table($table . ' as a') |
|
515 | - ->join($table . ' as rel', "a.{$ancestor}", '=', "rel.{$ancestor}") |
|
516 | - ->join($table . ' as d', "d.{$descendant}", '=', "rel.{$descendant}") |
|
514 | + $rows = $conn->table($table.' as a') |
|
515 | + ->join($table.' as rel', "a.{$ancestor}", '=', "rel.{$ancestor}") |
|
516 | + ->join($table.' as d', "d.{$descendant}", '=', "rel.{$descendant}") |
|
517 | 517 | ->where("a.{$descendant}", $parent->getKey()) |
518 | 518 | ->where("d.{$ancestor}", $item->getKey()) |
519 | - ->get(['rel.' . $item->getKeyName()]); |
|
519 | + ->get(['rel.'.$item->getKeyName()]); |
|
520 | 520 | |
521 | 521 | $ids = array_column($rows, $item->getKeyName()); |
522 | 522 | |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | $descendant = $item->getDescendantName(); |
540 | 540 | $depth = $item->getDepthName(); |
541 | 541 | |
542 | - $select = $conn->table($table . ' as a') |
|
543 | - ->joinWhere($table . ' as d', "d.{$ancestor}", '=', $item->getKey()) |
|
542 | + $select = $conn->table($table.' as a') |
|
543 | + ->joinWhere($table.' as d', "d.{$ancestor}", '=', $item->getKey()) |
|
544 | 544 | ->where("a.{$descendant}", '=', $parent->getKey()) |
545 | 545 | ->select([ |
546 | 546 | "a.{$ancestor}", |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | |
551 | 551 | $bindings = $select->getBindings(); |
552 | 552 | |
553 | - $insertQuery = sprintf("insert into %s (`{$ancestor}`, `{$descendant}`, `{$depth}`) ", $prefix . $table) |
|
553 | + $insertQuery = sprintf("insert into %s (`{$ancestor}`, `{$descendant}`, `{$depth}`) ", $prefix.$table) |
|
554 | 554 | . $select->toSql(); |
555 | 555 | |
556 | 556 | return $conn->insert($insertQuery, $bindings); |
@@ -702,12 +702,12 @@ discard block |
||
702 | 702 | protected function menuKeyString($value) |
703 | 703 | { |
704 | 704 | if ($value instanceof MenuItem) { |
705 | - $string = $value->menu->getKey() . '.' . implode('.', $value->getBreadcrumbs()); |
|
705 | + $string = $value->menu->getKey().'.'.implode('.', $value->getBreadcrumbs()); |
|
706 | 706 | } else { |
707 | 707 | $string = $value; |
708 | 708 | } |
709 | 709 | |
710 | - return $this->menuKeyword . '.' . $string; |
|
710 | + return $this->menuKeyword.'.'.$string; |
|
711 | 711 | } |
712 | 712 | |
713 | 713 | /** |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | */ |
824 | 824 | protected function permKeyString(MenuItem $item) |
825 | 825 | { |
826 | - return $item->menu->getKey() . '.' . implode('.', $item->getBreadcrumbs()); |
|
826 | + return $item->menu->getKey().'.'.implode('.', $item->getBreadcrumbs()); |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | /** |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | */ |
857 | 857 | public function setModel($model) |
858 | 858 | { |
859 | - $this->model = '\\' . ltrim($model, '\\'); |
|
859 | + $this->model = '\\'.ltrim($model, '\\'); |
|
860 | 860 | } |
861 | 861 | |
862 | 862 | /** |
@@ -137,7 +137,7 @@ |
||
137 | 137 | { |
138 | 138 | $config = [ |
139 | 139 | 'instanceId' => $instanceId, |
140 | - 'group' => 'documents_' . $instanceId, |
|
140 | + 'group' => 'documents_'.$instanceId, |
|
141 | 141 | ]; |
142 | 142 | |
143 | 143 | $config = array_merge($config, $params); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | { |
340 | 340 | $timestamp = time(); |
341 | 341 | if ($this->parentId == null || $this->parentId == '') { |
342 | - $this->setAttribute('head', $timestamp . '-' . $this->id); |
|
342 | + $this->setAttribute('head', $timestamp.'-'.$this->id); |
|
343 | 343 | } elseif ($this->parentId !== $this->id) { |
344 | 344 | $parent = static::find($this->parentId); |
345 | 345 | if ($parent === null) { |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $this->setAttribute('reply', $this->getReplyChar($parent)); |
349 | 349 | $this->setAttribute('head', $parent->head); |
350 | 350 | } |
351 | - $this->setAttribute('listOrder', $this->head . (isset($this->reply) ? $this->reply : '')); |
|
351 | + $this->setAttribute('listOrder', $this->head.(isset($this->reply) ? $this->reply : '')); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | protected function getReplyChar(Document $parent) |
382 | 382 | { |
383 | 383 | $lastReply = self::where('head', $parent->head) |
384 | - ->where('reply', 'like', $parent->reply . str_repeat('_', self::$replyCharLen)) |
|
384 | + ->where('reply', 'like', $parent->reply.str_repeat('_', self::$replyCharLen)) |
|
385 | 385 | ->max('reply'); |
386 | 386 | |
387 | 387 | $lastChar = null; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $lastChar = substr($lastReply, -1 * self::getReplyCharLen()); |
390 | 390 | } |
391 | 391 | |
392 | - return $parent->reply . $this->makeReplyChar($lastChar); |
|
392 | + return $parent->reply.$this->makeReplyChar($lastChar); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -408,15 +408,15 @@ discard block |
||
408 | 408 | return str_repeat($std[0], self::getReplyCharLen()); |
409 | 409 | } |
410 | 410 | |
411 | - if ($prevChars[strlen($prevChars)-1] == end($std)) { |
|
411 | + if ($prevChars[strlen($prevChars) - 1] == end($std)) { |
|
412 | 412 | if (strlen($prevChars) < 2) { |
413 | 413 | throw new ReplyLimitationException; |
414 | 414 | } |
415 | 415 | reset($std); |
416 | - $new = $this->makeReplyChar(substr($prevChars, 0, strlen($prevChars)-1)) . current($std); |
|
416 | + $new = $this->makeReplyChar(substr($prevChars, 0, strlen($prevChars) - 1)).current($std); |
|
417 | 417 | } else { |
418 | - $key = array_search($prevChars[strlen($prevChars)-1], $std); |
|
419 | - $new = substr($prevChars, 0, strlen($prevChars)-1) . $std[$key + 1]; |
|
418 | + $key = array_search($prevChars[strlen($prevChars) - 1], $std); |
|
419 | + $new = substr($prevChars, 0, strlen($prevChars) - 1).$std[$key + 1]; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | return $new; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | // sort |
149 | 149 | $activated = array_merge(array_flip($keys), $activated); |
150 | 150 | |
151 | - return array_filter($activated, function ($val) { |
|
151 | + return array_filter($activated, function($val) { |
|
152 | 152 | return !empty($val); |
153 | 153 | }); |
154 | 154 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function getConfigKey($id, $instanceId) |
176 | 176 | { |
177 | - return 'toggleMenu@' . $id . ($instanceId !== null ? '.' . $instanceId : ''); |
|
177 | + return 'toggleMenu@'.$id.($instanceId !== null ? '.'.$instanceId : ''); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -196,6 +196,6 @@ discard block |
||
196 | 196 | */ |
197 | 197 | private function getTypeKey($id) |
198 | 198 | { |
199 | - return $id . PluginRegister::KEY_DELIMITER . 'toggleMenu'; |
|
199 | + return $id.PluginRegister::KEY_DELIMITER.'toggleMenu'; |
|
200 | 200 | } |
201 | 201 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if (stripos($moduleId, 'module/') !== false) { |
40 | 40 | return $moduleId; |
41 | 41 | } else { |
42 | - return 'module/' . $moduleId; |
|
42 | + return 'module/'.$moduleId; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
@@ -101,7 +101,7 @@ |
||
101 | 101 | public function generate() |
102 | 102 | { |
103 | 103 | $version = $this->getMode(); |
104 | - $method = 'createIdVersion' . $version; |
|
104 | + $method = 'createIdVersion'.$version; |
|
105 | 105 | |
106 | 106 | if (!method_exists($this, $method)) { |
107 | 107 | throw new UnknownGeneratorVersionException(['version' => $version]); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | return $invocationHandler->callProxy( |
78 | 78 | $arguments, |
79 | 79 | // 등록된 advisor들이 모두 호출된 다음 마지막에 호출되어 target의 origin method를 실행하는 클로저 |
80 | - function () use ($method, $isCallMagicMethod) { |
|
80 | + function() use ($method, $isCallMagicMethod) { |
|
81 | 81 | $args = func_get_args(); |
82 | 82 | |
83 | 83 | if ($isCallMagicMethod) { |