diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 375003a..4112d74 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,11 +4,16 @@ $finder = PhpCsFixer\Finder::create()->in('plugins'); $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); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 4b8b334..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,19 +0,0 @@ -in(__DIR__.'/plugins') -; - -return PhpCsFixer\Config::create() - ->setRules([ - '@Symfony' => true, - 'align_multiline_comment' => true, - 'array_syntax' => ['syntax' => 'short'], - 'increment_style' => ['style' => 'post'], - 'list_syntax' => ['syntax' => 'short'], - 'standardize_increment' => false, - 'yoda_style' => false, - - ]) - ->setFinder($finder) -; diff --git a/composer.json b/composer.json index 918c622..c5f30c7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "bs-community/blessing-skin-plugins", "license": "MIT", "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0" + "friendsofphp/php-cs-fixer": "^3.13" }, "repositories": { "packagist": { diff --git a/plugins/forum-integration/views/config.blade.php b/plugins/forum-integration/views/config.blade.php index 71f9c3d..c2f577b 100644 --- a/plugins/forum-integration/views/config.blade.php +++ b/plugins/forum-integration/views/config.blade.php @@ -28,8 +28,8 @@ ]; config(['database.connections.remote' => array_merge( - forum_get_default_db_config(), $config - )]); + forum_get_default_db_config(), $config + )]); try { DB::connection('remote')->getPdo(); diff --git a/plugins/refresh-ali-cdn/bootstrap.php b/plugins/refresh-ali-cdn/bootstrap.php index 9978a95..4787ddb 100644 --- a/plugins/refresh-ali-cdn/bootstrap.php +++ b/plugins/refresh-ali-cdn/bootstrap.php @@ -90,7 +90,7 @@ return function (Dispatcher $events) { $signText = preg_replace('/\*/', '%2A', $signText); $signText = preg_replace('/%7E/', '~', $signText); $stringToSign = 'GET&%2F&'.$signText; - $signature = base64_encode(hash_hmac('sha1', $stringToSign, ($accessKeySecret.'&'), true)); + $signature = base64_encode(hash_hmac('sha1', $stringToSign, $accessKeySecret.'&', true)); // URL 拼接 $apiQuery['Signature'] = $signature; diff --git a/plugins/yggdrasil-api/src/Controllers/SessionController.php b/plugins/yggdrasil-api/src/Controllers/SessionController.php index 4095044..4c8ffd0 100644 --- a/plugins/yggdrasil-api/src/Controllers/SessionController.php +++ b/plugins/yggdrasil-api/src/Controllers/SessionController.php @@ -130,7 +130,7 @@ class SessionController extends Controller 'user_id' => $profile->player->uid, 'player_id' => $profile->player->pid, 'parameters' => json_encode($request->except('username')), - ], ($ip ? compact('ip') : []))); + ], $ip ? compact('ip') : [])); return response()->json()->setContent($response); }