@@ -11,7 +11,6 @@ |
||
11 | 11 | use Xpressengine\Support\Exceptions\InvalidArgumentHttpException; |
12 | 12 | use Xpressengine\User\Exceptions\EmailNotFoundException; |
13 | 13 | use Xpressengine\User\Exceptions\MailAlreadyExistsException; |
14 | -use Xpressengine\User\Models\User; |
|
15 | 14 | use Xpressengine\User\Rating; |
16 | 15 | use Xpressengine\User\Repositories\UserRepository; |
17 | 16 | use Xpressengine\User\UserHandler; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if ($group = $request->get('group')) { |
50 | 50 | $query = $query->whereHas( |
51 | 51 | 'groups', |
52 | - function (Builder $q) use ($group) { |
|
52 | + function(Builder $q) use ($group) { |
|
53 | 53 | $q->where('groupId', $group); |
54 | 54 | } |
55 | 55 | ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | if ($keyword = $request->get('keyword')) { |
69 | 69 | $query = $query->where( |
70 | - function (Builder $q) use ($field, $keyword) { |
|
70 | + function(Builder $q) use ($field, $keyword) { |
|
71 | 71 | foreach (explode(',', $field) as $f) { |
72 | 72 | $q->orWhere($f, 'like', '%'.$keyword.'%'); |
73 | 73 | }; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | return XePresenter::makeApi([]); |
452 | 452 | } |
453 | 453 | |
454 | - $matchedMemberList = $users->query()->where('displayName', 'like', '%'.$keyword.'%')->paginate( null, |
|
454 | + $matchedMemberList = $users->query()->where('displayName', 'like', '%'.$keyword.'%')->paginate(null, |
|
455 | 455 | ['id', 'displayName', 'email'] |
456 | 456 | )->items(); |
457 | 457 |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Illuminate\Http\Request; |
5 | 5 | use XePresenter; |
6 | -use XeSkin; |
|
7 | 6 | use Validator; |
8 | 7 | use Xpressengine\Skin\SkinHandler; |
9 | 8 | use Xpressengine\Support\Exceptions\InvalidArgumentException; |
@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * Get the services provided by the provider. |
60 | 60 | * |
61 | - * @return array |
|
61 | + * @return string[] |
|
62 | 62 | */ |
63 | 63 | public function provides() |
64 | 64 | { |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function register() |
60 | 60 | { |
61 | - $this->app->bind('xe.storage.temp', function ($app) { |
|
61 | + $this->app->bind('xe.storage.temp', function($app) { |
|
62 | 62 | return new TempFileCreator(); |
63 | 63 | }, true); |
64 | 64 | |
65 | - $this->app->bind('xe.storage', function ($app) { |
|
65 | + $this->app->bind('xe.storage', function($app) { |
|
66 | 66 | $distributor = new RoundRobinDistributor($app['config']['filesystems'], $app['xe.db']->connection()); |
67 | 67 | |
68 | 68 | $proxyClass = $app['xe.interception']->proxy(Storage::class, 'XeStorage'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $this->app->bind(Storage::class, 'xe.storage'); |
80 | 80 | |
81 | - $this->app->bind('xe.storage.url', function ($app) { |
|
81 | + $this->app->bind('xe.storage.url', function($app) { |
|
82 | 82 | return new UrlMaker( |
83 | 83 | $app['Illuminate\Contracts\Routing\UrlGenerator'], |
84 | 84 | $app['config']['filesystems.disks'] |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | intercept( |
89 | 89 | 'XeSettings@getManageMenu', |
90 | 90 | ['storage.managemenu' => ['before' => 'manage.sort']], |
91 | - function ($target) { |
|
92 | - $menu = $target(); |
|
91 | + function($target) { |
|
92 | + $menu = $target(); |
|
93 | 93 | $menu['contents']['submenu']['file'] = [ |
94 | 94 | 'title' => '파일', |
95 | 95 | 'description' => 'blur blur~', |
@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * Get the services provided by the provider. |
60 | 60 | * |
61 | - * @return array |
|
61 | + * @return string[] |
|
62 | 62 | */ |
63 | 63 | public function provides() |
64 | 64 | { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $this->app->singleton( |
98 | 98 | 'xe.auth', |
99 | - function ($app) { |
|
99 | + function($app) { |
|
100 | 100 | $proxyClass = $app['xe.interception']->proxy(Guard::class, 'Auth'); |
101 | 101 | return new $proxyClass( |
102 | 102 | new UserProvider($app['hash'], User::class), $app['session.store'], $app['request'] |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $this->app->singleton( |
117 | 117 | 'auth.password', |
118 | - function ($app) { |
|
118 | + function($app) { |
|
119 | 119 | // The password token repository is responsible for storing the email addresses |
120 | 120 | // and password reset tokens. It will be used to verify the tokens are valid |
121 | 121 | // for the given e-mail addresses. We will resolve an implementation here. |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | // register validator for password |
134 | 134 | $broker->validator( |
135 | - function ($credentials) { |
|
135 | + function($credentials) { |
|
136 | 136 | try { |
137 | 137 | return app('xe.user')->validatePassword($credentials['password']); |
138 | 138 | } catch (\Exception $e) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | $this->app->singleton( |
157 | 157 | 'xe.auth.email', |
158 | - function ($app) { |
|
158 | + function($app) { |
|
159 | 159 | $view = $app['config']['auth.confirm.email']; |
160 | 160 | |
161 | 161 | // The password broker uses a token repository to validate tokens and send user |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | { |
171 | 171 | $this->app->singleton( |
172 | 172 | 'xe.user.image', |
173 | - function ($app) { |
|
173 | + function($app) { |
|
174 | 174 | |
175 | 175 | $profileImgConfig = config('xe.user.profileImage'); |
176 | 176 | |
177 | 177 | return new UserImageHandler( |
178 | - $app['xe.storage'], $app['xe.media'], function () { |
|
178 | + $app['xe.storage'], $app['xe.media'], function() { |
|
179 | 179 | return Thumbnailer::getManager(); |
180 | 180 | }, $profileImgConfig |
181 | 181 | ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | $this->app->singleton( |
194 | 194 | 'auth.password.tokens', |
195 | - function ($app) { |
|
195 | + function($app) { |
|
196 | 196 | $connection = $app['db']->connection(); |
197 | 197 | |
198 | 198 | // The database token repository is an implementation of the token repository |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | { |
260 | 260 | $this->app->singleton( |
261 | 261 | 'xe.user', |
262 | - function ($app) { |
|
262 | + function($app) { |
|
263 | 263 | $proxyClass = $app['xe.interception']->proxy(UserHandler::class, 'XeUser'); |
264 | 264 | |
265 | 265 | $userHandler = new $proxyClass( |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | { |
299 | 299 | $this->app->singleton( |
300 | 300 | 'xe.users', |
301 | - function ($app) { |
|
301 | + function($app) { |
|
302 | 302 | return new UserRepository(User::class); |
303 | 303 | } |
304 | 304 | ); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | { |
315 | 315 | $this->app->singleton( |
316 | 316 | 'xe.user.accounts', |
317 | - function ($app) { |
|
317 | + function($app) { |
|
318 | 318 | return new UserAccountRepository(UserAccount::class); |
319 | 319 | } |
320 | 320 | ); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | $this->app->singleton( |
332 | 332 | 'xe.user.groups', |
333 | - function ($app) { |
|
333 | + function($app) { |
|
334 | 334 | return new UserGroupRepository(UserGroup::class); |
335 | 335 | } |
336 | 336 | ); |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | { |
347 | 347 | $this->app->singleton( |
348 | 348 | 'xe.user.virtualGroups', |
349 | - function ($app) { |
|
349 | + function($app) { |
|
350 | 350 | /** @var Closure $vGroups */ |
351 | 351 | $vGroups = $app['config']->get('xe.group.virtualGroup.all'); |
352 | 352 | /** @var Closure $getter */ |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | { |
362 | 362 | $this->app->singleton( |
363 | 363 | 'xe.user.emails', |
364 | - function ($app) { |
|
364 | + function($app) { |
|
365 | 365 | return new UserEmailRepository(UserEmail::class); |
366 | 366 | } |
367 | 367 | ); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | |
370 | 370 | $this->app->singleton( |
371 | 371 | 'xe.user.pendingEmails', |
372 | - function ($app) { |
|
372 | + function($app) { |
|
373 | 373 | return new PendingEmailRepository(PendingEmail::class); |
374 | 374 | } |
375 | 375 | ); |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | { |
408 | 408 | $this->app['auth']->extend( |
409 | 409 | 'xe', |
410 | - function ($app) { |
|
410 | + function($app) { |
|
411 | 411 | return $app['xe.auth']; |
412 | 412 | } |
413 | 413 | ); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | // 도메인이 생략된 이메일 validation 추가 |
427 | 427 | $validator->extend( |
428 | 428 | 'email_prefix', |
429 | - function ($attribute, $value, $parameters) { |
|
429 | + function($attribute, $value, $parameters) { |
|
430 | 430 | if (!str_contains($value, '@')) { |
431 | 431 | $value .= '@test.com'; |
432 | 432 | } |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $displayNameValidate = app('config')->get('xe.user.displayName.validate'); |
440 | 440 | $validator->extend( |
441 | 441 | 'display_name', |
442 | - function ($attribute, $value, $parameters) use ($displayNameValidate) { |
|
442 | + function($attribute, $value, $parameters) use ($displayNameValidate) { |
|
443 | 443 | return $displayNameValidate($value); |
444 | 444 | } |
445 | 445 | ); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | |
452 | 452 | $validator->extend( |
453 | 453 | 'password', |
454 | - function ($attribute, $value, $parameters) use ($validate) { |
|
454 | + function($attribute, $value, $parameters) use ($validate) { |
|
455 | 455 | return $validate($value); |
456 | 456 | }, |
457 | 457 | $level['description'] |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | $storage = $this->app['xe.storage']; |
500 | 500 | $media = $this->app['xe.media']; |
501 | 501 | User::setProfileImageResolver( |
502 | - function ($imageId) use ($default, $storage, $media) { |
|
502 | + function($imageId) use ($default, $storage, $media) { |
|
503 | 503 | try { |
504 | - if($imageId !== null) { |
|
504 | + if ($imageId !== null) { |
|
505 | 505 | /** @var Storage $storage */ |
506 | 506 | $file = File::find($imageId); |
507 | 507 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | return asset($mediaFile->url()); |
512 | 512 | } |
513 | 513 | } |
514 | - } catch(\Exception $e) { |
|
514 | + } catch (\Exception $e) { |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | return asset($default); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * Remove category |
85 | 85 | * |
86 | 86 | * @param Category $category category object |
87 | - * @return bool |
|
87 | + * @return boolean|null |
|
88 | 88 | */ |
89 | 89 | public function remove(Category $category) |
90 | 90 | { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * |
159 | 159 | * @param CategoryItem $item item object |
160 | 160 | * @param bool $force if true then remove all descendant |
161 | - * @return bool |
|
161 | + * @return boolean|null |
|
162 | 162 | */ |
163 | 163 | public function removeItem(CategoryItem $item, $force = true) |
164 | 164 | { |
@@ -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 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * get list |
341 | 341 | * |
342 | 342 | * @param array $columns get columns list |
343 | - * @return array|static[] |
|
343 | + * @return integer |
|
344 | 344 | */ |
345 | 345 | public function count($columns = '*') |
346 | 346 | { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * |
437 | 437 | * @param int $perPage count of list |
438 | 438 | * @param array $columns get columns |
439 | - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
|
439 | + * @return \Illuminate\Pagination\Paginator |
|
440 | 440 | */ |
441 | 441 | public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page') |
442 | 442 | { |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use Xpressengine\Config\ConfigEntity; |
17 | 17 | use Xpressengine\Database\Eloquent\DynamicModel; |
18 | 18 | use Xpressengine\Document\Exceptions\NotAllowedTypeException; |
19 | -use Xpressengine\Document\Exceptions\DocumentNotFoundException; |
|
20 | 19 | use Xpressengine\Document\Exceptions\ReplyLimitationException; |
21 | 20 | use Xpressengine\Document\Exceptions\ValueRequiredException; |
22 | 21 | use Illuminate\Database\Eloquent\Builder as OriginBuilder; |
@@ -428,7 +428,7 @@ |
||
428 | 428 | /** |
429 | 429 | * 덧글의 depth 반환 |
430 | 430 | * |
431 | - * @return float |
|
431 | + * @return integer |
|
432 | 432 | */ |
433 | 433 | public function getDepth() |
434 | 434 | { |
@@ -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; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * 파일이 특정 미디어 타입과 매칭된다며 해당 타입 반환 |
150 | 150 | * |
151 | 151 | * @param File $file file instance |
152 | - * @return string|null |
|
152 | + * @return integer|null |
|
153 | 153 | */ |
154 | 154 | public function getFileType(File $file) |
155 | 155 | { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * 미디어 삭제 |
213 | 213 | * |
214 | 214 | * @param Media $media media instance |
215 | - * @return bool |
|
215 | + * @return boolean|null |
|
216 | 216 | */ |
217 | 217 | public function remove(Media $media) |
218 | 218 | { |
@@ -231,7 +231,7 @@ |
||
231 | 231 | * |
232 | 232 | * @param string $name permission name |
233 | 233 | * @param string $siteKey site key name |
234 | - * @return Permission|null |
|
234 | + * @return Permission |
|
235 | 235 | */ |
236 | 236 | public function findOrNew($name, $siteKey = 'default') |
237 | 237 | { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function makeKeyForLoaded($siteKey, $name) |
173 | 173 | { |
174 | - return $siteKey .'-'. $name; |
|
174 | + return $siteKey.'-'.$name; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | protected function setAncestor(Permission $permission) |
200 | 200 | { |
201 | 201 | $ancestors = $this->repo->fetchAncestor($permission); |
202 | - usort($ancestors, function (Permission $a, Permission $b) { |
|
202 | + usort($ancestors, function(Permission $a, Permission $b) { |
|
203 | 203 | if ($a->getDepth() == $b->getDepth()) { |
204 | 204 | return 0; |
205 | 205 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $permission = $this->loaded[$this->makeKeyForLoaded($siteKey, $name)]; |
307 | 307 | $descendants = $this->repo->fetchDescendant($permission); |
308 | 308 | |
309 | - usort($descendants, function (Permission $a, Permission $b) { |
|
309 | + usort($descendants, function(Permission $a, Permission $b) { |
|
310 | 310 | if ($a->getDepth() == $b->getDepth()) { |
311 | 311 | return 0; |
312 | 312 | } |