From d1d2ca97d8af1e3a04e05b66ef43574e9982d58c Mon Sep 17 00:00:00 2001 From: Zing Date: Thu, 6 Jan 2022 17:27:13 +0800 Subject: [PATCH] Simplify ECS skip option (#29) --- composer.json | 7 +++++-- ecs.php | 9 +-------- tests/DriverTest.php | 5 ++++- tests/TestCase.php | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 81dbb07..7788496 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,10 @@ ], "config": { "sort-packages": true, - "preferred-install": "dist" + "preferred-install": "dist", + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "require": { "php": "^8.0", @@ -23,7 +26,7 @@ "nunomaduro/larastan": "^1.0", "orchestra/testbench": "^7.0", "phpunit/phpunit": "^8.0,<8.5.12 || ^9.3.3", - "zing/coding-standard": "^5.0" + "zing/coding-standard": "^5.1" }, "autoload": { "psr-4": { diff --git a/ecs.php b/ecs.php index 772b77e..db7d3a4 100644 --- a/ecs.php +++ b/ecs.php @@ -2,9 +2,6 @@ declare(strict_types=1); -use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; -use PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer; -use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symplify\EasyCodingStandard\ValueObject\Option; use Zing\CodingStandard\Set\ECSSetList; @@ -15,11 +12,7 @@ $containerConfigurator->import(ECSSetList::PHP80_MIGRATION_RISKY); $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::SKIP, [ - YodaStyleFixer::class => null, - PhpUnitInternalClassFixer::class, - PhpUnitTestClassRequiresCoversFixer::class, - ]); + $parameters->set(Option::PARALLEL, true); $parameters->set( Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php', __DIR__ . '/rector.php'] diff --git a/tests/DriverTest.php b/tests/DriverTest.php index 7702a35..9ce79a1 100644 --- a/tests/DriverTest.php +++ b/tests/DriverTest.php @@ -9,7 +9,10 @@ use Obs\ObsClient; use Zing\Flysystem\Obs\ObsAdapter; -class DriverTest extends TestCase +/** + * @internal + */ +final class DriverTest extends TestCase { public function testDriverRegistered(): void { diff --git a/tests/TestCase.php b/tests/TestCase.php index c4b57a0..84a074b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,7 +8,7 @@ use Orchestra\Testbench\TestCase as BaseTestCase; use Zing\LaravelFlysystem\Obs\ObsServiceProvider; -class TestCase extends BaseTestCase +abstract class TestCase extends BaseTestCase { /** * @param mixed $app