From ce02d1fcaf65d86a5ace7b0e47cd1d3e21c2d54c Mon Sep 17 00:00:00 2001 From: yaozm Date: Wed, 18 Oct 2023 16:14:17 +0800 Subject: [PATCH] fix(.php-cs-fixer): update curly_braces_position - 'curly_braces_position' changed to 'braces_position' --- .php-cs-fixer.php | 13 ++++++++----- _ide_helper.php | 16 ++++------------ src/Contracts/Throwable.php | 4 +--- src/Exceptions/InvalidArgumentException.php | 4 +--- src/Facades/Soar.php | 2 -- src/JavascriptRenderer.php | 5 +++-- src/Outputs/DebugBarOutput.php | 2 +- src/Outputs/DumpOutput.php | 4 ++-- src/Outputs/ErrorLogOutput.php | 8 ++++---- src/Outputs/LogOutput.php | 2 +- src/Outputs/RayOutput.php | 4 ++-- src/Outputs/SoarBarOutput.php | 2 +- src/Outputs/SyslogOutput.php | 2 +- tests/Pest.php | 12 ++++-------- tests/TestCase.php | 7 ++----- 15 files changed, 35 insertions(+), 52 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 8165adf..b49d513 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -90,7 +90,7 @@ // array_notation // basic - 'curly_braces_position' => [ + 'braces_position' => [ 'control_structures_opening_brace' => 'same_line', 'functions_opening_brace' => 'next_line_unless_newline_at_signature_end', 'anonymous_functions_opening_brace' => 'same_line', @@ -197,7 +197,7 @@ // list_notation // namespace_notation - 'no_blank_lines_before_namespace' => false, + 'blank_lines_before_namespace' => true, // naming @@ -219,6 +219,8 @@ 'methods' => [], ], 'php_unit_test_class_requires_covers' => false, + 'php_unit_data_provider_name' => true, + 'php_unit_data_provider_return_type' => true, // phpdoc 'phpdoc_align' => [ @@ -259,6 +261,7 @@ 'var', ], ], + 'phpdoc_param_order' => true, // return_notation 'simplified_null_return' => true, @@ -305,8 +308,8 @@ 'functions' => ['print_r', 'var_dump', 'var_export'], ], // PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer::name() => true, - PhpCsFixerCustomFixers\Fixer\DataProviderNameFixer::name() => true, - PhpCsFixerCustomFixers\Fixer\DataProviderReturnTypeFixer::name() => true, + // PhpCsFixerCustomFixers\Fixer\DataProviderNameFixer::name() => true, + // PhpCsFixerCustomFixers\Fixer\DataProviderReturnTypeFixer::name() => true, // PhpCsFixerCustomFixers\Fixer\DeclareAfterOpeningTagFixer::name() => true, // PhpCsFixerCustomFixers\Fixer\EmptyFunctionBodyFixer::name() => true, // PhpCsFixerCustomFixers\Fixer\IssetToArrayKeyExistsFixer::name() => true, @@ -357,7 +360,7 @@ // 'var', // ], // ], - PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer::name() => true, + // PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer::name() => true, PhpCsFixerCustomFixers\Fixer\PhpdocParamTypeFixer::name() => true, PhpCsFixerCustomFixers\Fixer\PhpdocSelfAccessorFixer::name() => true, PhpCsFixerCustomFixers\Fixer\PhpdocSingleLineVarFixer::name() => true, diff --git a/_ide_helper.php b/_ide_helper.php index b44396b..0948d98 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -11,9 +11,7 @@ */ namespace { - class Soar extends \Guanguans\LaravelSoar\Facades\Soar - { - } + class Soar extends \Guanguans\LaravelSoar\Facades\Soar {} } namespace Illuminate\Database\Query { @@ -34,9 +32,7 @@ class Soar extends \Guanguans\LaravelSoar\Facades\Soar * @see \Guanguans\LaravelSoar\Macros\QueryBuilderMacro * @see \Illuminate\Database\Query\Builder */ - class Builder - { - } + class Builder {} } namespace Illuminate\Database\Eloquent { @@ -59,9 +55,7 @@ class Builder * @see \Guanguans\LaravelSoar\Macros\QueryBuilderMacro * @see \Illuminate\Database\Eloquent\Builder */ - class Builder - { - } + class Builder {} } namespace Illuminate\Database\Eloquent\Relations { @@ -84,7 +78,5 @@ class Builder * @see \Guanguans\LaravelSoar\Macros\QueryBuilderMacro * @see \Illuminate\Database\Eloquent\Relations\Relation */ - class Relation - { - } + class Relation {} } diff --git a/src/Contracts/Throwable.php b/src/Contracts/Throwable.php index bdbf833..41f598a 100644 --- a/src/Contracts/Throwable.php +++ b/src/Contracts/Throwable.php @@ -12,6 +12,4 @@ namespace Guanguans\LaravelSoar\Contracts; -interface Throwable extends \Throwable -{ -} +interface Throwable extends \Throwable {} diff --git a/src/Exceptions/InvalidArgumentException.php b/src/Exceptions/InvalidArgumentException.php index 5881392..5b55257 100644 --- a/src/Exceptions/InvalidArgumentException.php +++ b/src/Exceptions/InvalidArgumentException.php @@ -14,6 +14,4 @@ use Guanguans\LaravelSoar\Contracts\Throwable; -class InvalidArgumentException extends \InvalidArgumentException implements Throwable -{ -} +class InvalidArgumentException extends \InvalidArgumentException implements Throwable {} diff --git a/src/Facades/Soar.php b/src/Facades/Soar.php index d93d6f3..c10c0eb 100644 --- a/src/Facades/Soar.php +++ b/src/Facades/Soar.php @@ -54,8 +54,6 @@ class Soar extends Facade { /** * @noinspection MissingParentCallInspection - * - * {@inheritDoc} */ protected static function getFacadeAccessor(): string { diff --git a/src/JavascriptRenderer.php b/src/JavascriptRenderer.php index 26a32e0..4ef7974 100644 --- a/src/JavascriptRenderer.php +++ b/src/JavascriptRenderer.php @@ -192,9 +192,10 @@ protected function getModifiedTime(?string $type): int } /** - * {@inheritDoc} - * * @noinspection MissingParentCallInspection + * + * @param mixed $uri + * @param mixed $root */ protected function makeUriRelativeTo($uri, $root) { diff --git a/src/Outputs/DebugBarOutput.php b/src/Outputs/DebugBarOutput.php index c820c11..51e7f54 100644 --- a/src/Outputs/DebugBarOutput.php +++ b/src/Outputs/DebugBarOutput.php @@ -30,7 +30,7 @@ public function __construct(string $name = 'Soar Scores', string $label = 'warni } /** - * {@inheritDoc} + * @param mixed $dispatcher * * @throws \JsonException */ diff --git a/src/Outputs/DumpOutput.php b/src/Outputs/DumpOutput.php index 8830c3f..ea3a360 100644 --- a/src/Outputs/DumpOutput.php +++ b/src/Outputs/DumpOutput.php @@ -24,11 +24,11 @@ public function __construct(bool $exit = false) } /** - * {@inheritDoc} - * * @noinspection ForgottenDebugOutputInspection * @noinspection ClosureToArrowFunctionInspection * @noinspection DebugFunctionUsageInspection + * + * @param mixed $dispatcher */ public function output(Collection $scores, $dispatcher): void { diff --git a/src/Outputs/ErrorLogOutput.php b/src/Outputs/ErrorLogOutput.php index 45cb16a..79d5bea 100644 --- a/src/Outputs/ErrorLogOutput.php +++ b/src/Outputs/ErrorLogOutput.php @@ -28,12 +28,12 @@ public function __construct(int $messageType = 0, string $destination = '', stri } /** - * {@inheritDoc} - * - * @throws \JsonException - * * @noinspection ForgottenDebugOutputInspection * @noinspection DebugFunctionUsageInspection + * + * @param mixed $dispatcher + * + * @throws \JsonException */ public function output(Collection $scores, $dispatcher): void { diff --git a/src/Outputs/LogOutput.php b/src/Outputs/LogOutput.php index b1a4e0e..dabf02e 100644 --- a/src/Outputs/LogOutput.php +++ b/src/Outputs/LogOutput.php @@ -27,7 +27,7 @@ public function __construct(string $channel = 'daily', string $level = 'warning' } /** - * {@inheritDoc} + * @param mixed $dispatcher * * @throws \JsonException */ diff --git a/src/Outputs/RayOutput.php b/src/Outputs/RayOutput.php index f64319a..959fb06 100644 --- a/src/Outputs/RayOutput.php +++ b/src/Outputs/RayOutput.php @@ -24,9 +24,9 @@ public function __construct(string $label = 'Soar Scores') } /** - * {@inheritDoc} - * * @psalm-suppress UndefinedDocblockClass + * + * @param mixed $dispatcher */ public function output(Collection $scores, $dispatcher): void { diff --git a/src/Outputs/SoarBarOutput.php b/src/Outputs/SoarBarOutput.php index 2ae9ff1..71c1d84 100644 --- a/src/Outputs/SoarBarOutput.php +++ b/src/Outputs/SoarBarOutput.php @@ -28,7 +28,7 @@ public function __construct(string $name = 'Scores', string $label = 'warning') } /** - * {@inheritDoc} + * @param mixed $dispatcher * * @throws \JsonException */ diff --git a/src/Outputs/SyslogOutput.php b/src/Outputs/SyslogOutput.php index e0fe48d..971d60a 100644 --- a/src/Outputs/SyslogOutput.php +++ b/src/Outputs/SyslogOutput.php @@ -24,7 +24,7 @@ public function __construct(int $priority = LOG_WARNING) } /** - * {@inheritDoc} + * @param mixed $dispatcher * * @throws \JsonException */ diff --git a/tests/Pest.php b/tests/Pest.php index 040fda6..e505ab8 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -13,14 +13,10 @@ namespace Tests; uses(TestCase::class) - ->beforeAll(function (): void { - }) - ->beforeEach(function (): void { - }) - ->afterEach(function (): void { - }) - ->afterAll(function (): void { - }) + ->beforeAll(function (): void {}) + ->beforeEach(function (): void {}) + ->afterEach(function (): void {}) + ->afterAll(function (): void {}) ->in(__DIR__); expect()->extend('between', function (int $min, $max) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 55aaeec..0685a22 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -101,9 +101,6 @@ protected function getPackageProviders($app) ]; } - /** - * {@inheritDoc} - */ protected function defineEnvironment($app): void { config()->set('app.key', 'base64:6Cu/ozj4gPtIjmXjr8EdVnGFNsdRqZfHfVjQkmTlg4Y='); @@ -138,10 +135,10 @@ protected function setUpDatabase(): void } /** - * {@inheritDoc} - * * @noinspection PhpUndefinedMethodInspection * @noinspection PhpUndefinedFieldInspection + * + * @param mixed $router */ protected function defineRoutes($router): void {