@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $row = $this->conn->table($this->table)->where('siteKey', $siteKey)->where('name', $name)->first(); |
66 | 66 | |
67 | 67 | if ($row !== null) { |
68 | - return $this->createModel((array)$row); |
|
68 | + return $this->createModel((array) $row); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return null; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $items = []; |
90 | 90 | foreach ($rows as $row) { |
91 | - $items[] = $this->createModel((array)$row); |
|
91 | + $items[] = $this->createModel((array) $row); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | return $items; |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | { |
107 | 107 | $rows = $this->conn->table($this->table) |
108 | 108 | ->where('siteKey', $siteKey) |
109 | - ->where('name', 'like', $name . '.%') |
|
109 | + ->where('name', 'like', $name.'.%') |
|
110 | 110 | ->where('name', '<>', $name)->get(); |
111 | 111 | |
112 | 112 | $items = []; |
113 | 113 | foreach ($rows as $row) { |
114 | - $items[] = $this->createModel((array)$row); |
|
114 | + $items[] = $this->createModel((array) $row); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | return $items; |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | { |
147 | 147 | $query = $this->conn->table($this->table) |
148 | 148 | ->where('siteKey', $config->siteKey) |
149 | - ->where('name', 'like', $config->name . '%') |
|
149 | + ->where('name', 'like', $config->name.'%') |
|
150 | 150 | ->where('name', '<>', $config->name); |
151 | 151 | |
152 | 152 | foreach ($excepts as $except) { |
153 | - $query->where('name', 'not like', $except . '%'); |
|
153 | + $query->where('name', 'not like', $except.'%'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | $query->update( |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | { |
171 | 171 | $this->conn->table($this->table) |
172 | 172 | ->where('siteKey', $siteKey) |
173 | - ->where(function ($query) use ($name) { |
|
174 | - $query->where('name', 'like', $name . '.%') |
|
173 | + ->where(function($query) use ($name) { |
|
174 | + $query->where('name', 'like', $name.'.%') |
|
175 | 175 | ->orWhere('name', $name); |
176 | 176 | })->delete(); |
177 | 177 | } |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | { |
224 | 224 | $query = $this->conn->table($this->table) |
225 | 225 | ->where('siteKey', $config->siteKey) |
226 | - ->where(function ($query) use ($config) { |
|
226 | + ->where(function($query) use ($config) { |
|
227 | 227 | $query->where('name', $config->name) |
228 | - ->orWhere('name', 'like', $config->name . '.%'); |
|
228 | + ->orWhere('name', 'like', $config->name.'.%'); |
|
229 | 229 | }); |
230 | 230 | |
231 | 231 | $arr = explode('.', $config->name); |
@@ -252,9 +252,9 @@ discard block |
||
252 | 252 | if ($to !== null) { |
253 | 253 | $this->conn->table($this->table) |
254 | 254 | ->where('siteKey', $config->siteKey) |
255 | - ->where(function ($query) use ($config) { |
|
255 | + ->where(function($query) use ($config) { |
|
256 | 256 | $query->where('name', $config->name) |
257 | - ->orWhere('name', 'like', $config->name . '.%'); |
|
257 | + ->orWhere('name', 'like', $config->name.'.%'); |
|
258 | 258 | }) |
259 | 259 | ->update(['name' => $this->conn->raw("concat('{$to}', '.', `name`)")]); |
260 | 260 | } |
@@ -104,7 +104,7 @@ |
||
104 | 104 | */ |
105 | 105 | public static function setItemModel($model) |
106 | 106 | { |
107 | - static::$itemModel = '\\' . ltrim($model, '\\'); |
|
107 | + static::$itemModel = '\\'.ltrim($model, '\\'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | $descendant = $item->getDescendantName(); |
260 | 260 | $depth = $item->getDepthName(); |
261 | 261 | |
262 | - $select = $conn->table($table . ' as a') |
|
263 | - ->joinWhere($table . ' as d', "d.{$ancestor}", '=', $item->getKey()) |
|
262 | + $select = $conn->table($table.' as a') |
|
263 | + ->joinWhere($table.' as d', "d.{$ancestor}", '=', $item->getKey()) |
|
264 | 264 | ->where("a.{$descendant}", '=', $parent->getKey()) |
265 | 265 | ->select([ |
266 | 266 | "a.{$ancestor}", |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | $bindings = $select->getBindings(); |
272 | 272 | |
273 | - $insertQuery = sprintf("insert into %s (`{$ancestor}`, `{$descendant}`, `{$depth}`) ", $prefix . $table) |
|
273 | + $insertQuery = sprintf("insert into %s (`{$ancestor}`, `{$descendant}`, `{$depth}`) ", $prefix.$table) |
|
274 | 274 | . $select->toSql(); |
275 | 275 | |
276 | 276 | return $conn->insert($insertQuery, $bindings); |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | $ancestor = $item->getAncestorName(); |
291 | 291 | $descendant = $item->getDescendantName(); |
292 | 292 | |
293 | - $rows = $conn->table($table . ' as a') |
|
294 | - ->join($table . ' as rel', "a.{$ancestor}", '=', "rel.{$ancestor}") |
|
295 | - ->join($table . ' as d', "d.{$descendant}", '=', "rel.{$descendant}") |
|
293 | + $rows = $conn->table($table.' as a') |
|
294 | + ->join($table.' as rel', "a.{$ancestor}", '=', "rel.{$ancestor}") |
|
295 | + ->join($table.' as d', "d.{$descendant}", '=', "rel.{$descendant}") |
|
296 | 296 | ->where("a.{$descendant}", $parent->getKey()) |
297 | 297 | ->where("d.{$ancestor}", $item->getKey()) |
298 | - ->get(['rel.' . $item->getKeyName()]); |
|
298 | + ->get(['rel.'.$item->getKeyName()]); |
|
299 | 299 | |
300 | 300 | $ids = array_column($rows, $item->getKeyName()); |
301 | 301 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | /** @var Collection $children */ |
322 | - $children = $children->filter(function (CategoryItem $model) use ($item) { |
|
322 | + $children = $children->filter(function(CategoryItem $model) use ($item) { |
|
323 | 323 | return $model->getKey() != $item->getKey(); |
324 | 324 | }); |
325 | 325 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | ->merge([$item]) |
328 | 328 | ->merge($children->slice($position)); |
329 | 329 | |
330 | - $children->each(function (CategoryItem $model, $idx) { |
|
330 | + $children->each(function(CategoryItem $model, $idx) { |
|
331 | 331 | $model->{$model->getOrderKeyName()} = $idx; |
332 | 332 | $model->save(); |
333 | 333 | }); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function setModel($model) |
353 | 353 | { |
354 | - $this->model = '\\' . ltrim($model, '\\'); |
|
354 | + $this->model = '\\'.ltrim($model, '\\'); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $sorted = static::$sorter->sort(array_diff(array_keys($list), static::$unloaded)); |
68 | 68 | |
69 | 69 | array_map( |
70 | - function ($file) use ($list, &$output, $minified) { |
|
70 | + function($file) use ($list, &$output, $minified) { |
|
71 | 71 | $fileObj = $list[$file]; |
72 | 72 | $output .= $fileObj->render($file, $minified); |
73 | 73 | }, |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | $prev = null; |
163 | - foreach ((array)$this->files as $file) { |
|
163 | + foreach ((array) $this->files as $file) { |
|
164 | 164 | |
165 | 165 | static::$fileList[$file] = $this; |
166 | 166 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public static function output() |
62 | 62 | { |
63 | - $output = '<script type="text/javascript">' . PHP_EOL; |
|
63 | + $output = '<script type="text/javascript">'.PHP_EOL; |
|
64 | 64 | |
65 | 65 | $list = static::$ruleList; |
66 | 66 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __construct($ruleName, $rules) |
94 | 94 | { |
95 | - if (isset(self::$ruleList[$ruleName]) === true) { |
|
95 | + if (isset(self::$ruleList[$ruleName]) === true) { |
|
96 | 96 | $rules = array_merge($rules, self::$ruleList[$ruleName]->getRules()); |
97 | 97 | } |
98 | - $this->ruleName = $ruleName; |
|
99 | - $this->rules = $rules; |
|
98 | + $this->ruleName = $ruleName; |
|
99 | + $this->rules = $rules; |
|
100 | 100 | self::$ruleList[$ruleName] = $this; |
101 | 101 | |
102 | 102 | // Rule 을 사용할 때 validator 를 사용하게 되므로 valiator 다국어 추가 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | 'System.import(\'xecore:/common/js/modules/validator\').then(function(validator) { validator.setRules("%s", %s); });', |
131 | 131 | $this->ruleName, |
132 | 132 | json_enc($this->rules) |
133 | - ) . PHP_EOL; |
|
133 | + ).PHP_EOL; |
|
134 | 134 | |
135 | 135 | return $rule; |
136 | 136 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $sorted = static::$sorter->sort(array_diff(array_keys($list), static::$unloaded)); |
84 | 84 | |
85 | 85 | array_map( |
86 | - function ($alias) use ($list, &$output) { |
|
86 | + function($alias) use ($list, &$output) { |
|
87 | 87 | $htmlObj = $list[$alias]; |
88 | 88 | $output .= $htmlObj->render(); |
89 | 89 | }, |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $sorted = static::$sorter->sort(array_diff(array_keys($list), static::$unloaded)); |
73 | 73 | |
74 | 74 | array_map( |
75 | - function ($file) use ($list, &$output, $minified) { |
|
75 | + function($file) use ($list, &$output, $minified) { |
|
76 | 76 | $fileObj = $list[$file]; |
77 | 77 | $output .= $fileObj->render($file, $minified); |
78 | 78 | }, |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $user = $this->query()->whereHas( |
80 | 80 | 'emails', |
81 | - function ($q) use ($address) { |
|
81 | + function($q) use ($address) { |
|
82 | 82 | $q->where('address', $address); |
83 | 83 | } |
84 | 84 | )->first(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $users = $this->query()->whereHas( |
100 | 100 | 'emails', |
101 | - function ($q) use ($emailPrefix) { |
|
101 | + function($q) use ($emailPrefix) { |
|
102 | 102 | $q->where('address', 'like', $emailPrefix.'@%'); |
103 | 103 | } |
104 | 104 | )->get(); |
@@ -130,7 +130,7 @@ |
||
130 | 130 | { |
131 | 131 | $this->frontend->js('https://www.google.com/recaptcha/api.js')->appendTo('head')->load(); |
132 | 132 | |
133 | - return '<div class="g-recaptcha" data-sitekey="' . $this->siteKey . '"></div>'; |
|
133 | + return '<div class="g-recaptcha" data-sitekey="'.$this->siteKey.'"></div>'; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |