update php-cs-fixer config & apply fixes
This commit is contained in:
parent
64dea61ec9
commit
eff859a864
@ -8,11 +8,16 @@ $finder = PhpCsFixer\Finder::create()
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@Symfony' => true,
|
||||
'align_multiline_comment' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'increment_style' => ['style' => 'post'],
|
||||
'list_syntax' => ['syntax' => 'short'],
|
||||
'yoda_style' => false,
|
||||
])
|
||||
'@Symfony' => true,
|
||||
'align_multiline_comment' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'increment_style' => ['style' => 'post'],
|
||||
'list_syntax' => ['syntax' => 'short'],
|
||||
'yoda_style' => false,
|
||||
'global_namespace_import' => [
|
||||
'import_constants' => true,
|
||||
'import_functions' => true,
|
||||
'import_classes' => null,
|
||||
],
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
@ -53,7 +53,7 @@ class AdminController extends Controller
|
||||
|
||||
$grouping = fn ($field) => fn ($item) => Carbon::parse($item->$field)->isoFormat('l');
|
||||
$mapping = fn ($item) => count($item);
|
||||
$aligning = fn ($data) => fn ($day) => ($data->get($day) ?? 0);
|
||||
$aligning = fn ($data) => fn ($day) => $data->get($day) ?? 0;
|
||||
|
||||
/** @var Collection */
|
||||
$userRegistration = User::where('register_at', '>=', $oneMonthAgo)
|
||||
|
@ -142,9 +142,9 @@ class AuthControllerTest extends TestCase
|
||||
// Should check captcha if there are too many fails
|
||||
Cache::put($loginFailsCacheKey, 4);
|
||||
$this->postJson(
|
||||
'/auth/login', [
|
||||
'identification' => $user->email,
|
||||
'password' => '12345678',
|
||||
'/auth/login', [
|
||||
'identification' => $user->email,
|
||||
'password' => '12345678',
|
||||
])->assertJsonValidationErrors('captcha');
|
||||
|
||||
Cache::flush();
|
||||
|
@ -249,23 +249,23 @@ class PlayerControllerTest extends TestCase
|
||||
// Only A-Za-z0-9_ are allowed
|
||||
option(['player_name_rule' => 'official']);
|
||||
$this->putJson(
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => '角色名']
|
||||
)->assertJsonValidationErrors('name');
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => '角色名']
|
||||
)->assertJsonValidationErrors('name');
|
||||
|
||||
// Other invalid characters
|
||||
option(['player_name_rule' => 'cjk']);
|
||||
$this->putJson(
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => '\\']
|
||||
)->assertJsonValidationErrors('name');
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => '\\']
|
||||
)->assertJsonValidationErrors('name');
|
||||
|
||||
// with an existed player name
|
||||
$existed = Player::factory()->create();
|
||||
$this->putJson(
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => $existed->name]
|
||||
)->assertJsonValidationErrors('name');
|
||||
route('user.player.rename', ['player' => $player]),
|
||||
['name' => $existed->name]
|
||||
)->assertJsonValidationErrors('name');
|
||||
|
||||
// Rejected by filter
|
||||
$filter = Fakes\Filter::fake();
|
||||
@ -350,12 +350,12 @@ class PlayerControllerTest extends TestCase
|
||||
// set a private texture
|
||||
$private = Texture::factory()->private()->create();
|
||||
$this->putJson(
|
||||
route('user.player.set', ['player' => $player]),
|
||||
['skin' => $private->tid]
|
||||
)->assertJson([
|
||||
'code' => 1,
|
||||
'message' => trans('user.closet.remove.non-existent'),
|
||||
]);
|
||||
route('user.player.set', ['player' => $player]),
|
||||
['skin' => $private->tid]
|
||||
)->assertJson([
|
||||
'code' => 1,
|
||||
'message' => trans('user.closet.remove.non-existent'),
|
||||
]);
|
||||
|
||||
// set for "skin" type
|
||||
Event::fake();
|
||||
|
Loading…
Reference in New Issue
Block a user