mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-12 13:44:41 +08:00
Apply fixes from StyleCI (#18) [skip ci]
This pull request applies code style fixes from an analysis carried out by [StyleCI](https://github.styleci.io). --- For more information, click [here](https://github.styleci.io/analyses/zYNYDd).
This commit is contained in:
parent
5915b3ec17
commit
1afa36e8e9
@ -40,8 +40,9 @@ class MigrateCloset extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (!Schema::hasTable('closets')) {
|
||||
if (! Schema::hasTable('closets')) {
|
||||
$this->info('Nothing to do.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ class ClosetController extends Controller
|
||||
// Pagination
|
||||
$items = $closet->get()->map(function ($t) {
|
||||
$t->name = $t->pivot->item_name;
|
||||
|
||||
return $t;
|
||||
});
|
||||
$totalPages = ceil($items->count() / $perPage);
|
||||
@ -98,6 +99,7 @@ class ClosetController extends Controller
|
||||
}
|
||||
|
||||
$user->closet()->updateExistingPivot($request->tid, ['item_name' => $request->new_name]);
|
||||
|
||||
return json(trans('user.closet.rename.success', ['name' => $request->new_name]), 0);
|
||||
}
|
||||
|
||||
|
@ -211,6 +211,7 @@ class SkinlibController extends Controller
|
||||
$user->setScore($cost, 'minus');
|
||||
|
||||
$user->closet()->attach($t->tid, ['item_name' => $t->name]);
|
||||
|
||||
return json(trans('skinlib.upload.success', ['name' => $request->input('name')]), 0, [
|
||||
'tid' => $t->tid,
|
||||
]);
|
||||
|
@ -318,6 +318,7 @@ class User extends Authenticatable
|
||||
public function delete()
|
||||
{
|
||||
Player::where('uid', $this->uid)->delete();
|
||||
|
||||
return parent::delete();
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ class SkinlibControllerTest extends TestCase
|
||||
])
|
||||
->decodeResponseJson('items');
|
||||
$this->assertTrue(collect($items)->every(function ($item) {
|
||||
return !$item['liked'];
|
||||
return ! $item['liked'];
|
||||
}));
|
||||
|
||||
// A user has added a texture from skin library to his closet
|
||||
@ -281,7 +281,7 @@ class SkinlibControllerTest extends TestCase
|
||||
$this->getJson('/skinlib/data')
|
||||
->assertJson([
|
||||
'items' => [
|
||||
['tid' => $texture->tid, 'liked' => true]
|
||||
['tid' => $texture->tid, 'liked' => true],
|
||||
],
|
||||
'current_uid' => $otherUser->uid,
|
||||
'total_pages' => 2,
|
||||
|
Loading…
Reference in New Issue
Block a user