From 1cdc8f09134552cce522be8545d74de411107647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 14 Jan 2022 23:39:22 +0100 Subject: [PATCH] Fix: Imports --- test/Unit/FactoryTest.php | 15 ++++++++------- test/Unit/RuleSet/AbstractRuleSetTestCase.php | 8 ++++---- test/Unit/RuleSet/ExplicitRuleSetTestCase.php | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/test/Unit/FactoryTest.php b/test/Unit/FactoryTest.php index 3636ba54..28f52bc2 100644 --- a/test/Unit/FactoryTest.php +++ b/test/Unit/FactoryTest.php @@ -13,7 +13,8 @@ namespace Ergebnis\PhpCsFixer\Config\Test\Unit; -use Ergebnis\PhpCsFixer\Config; +use Ergebnis\PhpCsFixer\Config\Factory; +use Ergebnis\PhpCsFixer\Config\Test; use Ergebnis\Test\Util; use PHPUnit\Framework; @@ -30,7 +31,7 @@ public function testFromRuleSetThrowsRuntimeExceptionIfCurrentPhpVersionIsLessTh { $targetPhpVersion = \PHP_VERSION_ID + 1; - $ruleSet = new Config\Test\Double\Config\RuleSet\DummyRuleSet( + $ruleSet = new Test\Double\Config\RuleSet\DummyRuleSet( self::faker()->word, [], $targetPhpVersion, @@ -43,7 +44,7 @@ public function testFromRuleSetThrowsRuntimeExceptionIfCurrentPhpVersionIsLessTh $targetPhpVersion, )); - Config\Factory::fromRuleSet($ruleSet); + Factory::fromRuleSet($ruleSet); } /** @@ -58,13 +59,13 @@ public function testFromRuleSetCreatesConfig(int $targetPhpVersion): void ], ]; - $ruleSet = new Config\Test\Double\Config\RuleSet\DummyRuleSet( + $ruleSet = new Test\Double\Config\RuleSet\DummyRuleSet( self::faker()->word, $rules, $targetPhpVersion, ); - $config = Config\Factory::fromRuleSet($ruleSet); + $config = Factory::fromRuleSet($ruleSet); self::assertTrue($config->getUsingCache()); self::assertTrue($config->getRiskyAllowed()); @@ -97,7 +98,7 @@ public function testFromRuleSetCreatesConfigWithOverrideRules(): void ], ]; - $ruleSet = new Config\Test\Double\Config\RuleSet\DummyRuleSet( + $ruleSet = new Test\Double\Config\RuleSet\DummyRuleSet( self::faker()->word, $rules, \PHP_VERSION_ID, @@ -107,7 +108,7 @@ public function testFromRuleSetCreatesConfigWithOverrideRules(): void 'foo' => false, ]; - $config = Config\Factory::fromRuleSet( + $config = Factory::fromRuleSet( $ruleSet, $overrideRules, ); diff --git a/test/Unit/RuleSet/AbstractRuleSetTestCase.php b/test/Unit/RuleSet/AbstractRuleSetTestCase.php index 7f543d62..2dfef0ad 100644 --- a/test/Unit/RuleSet/AbstractRuleSetTestCase.php +++ b/test/Unit/RuleSet/AbstractRuleSetTestCase.php @@ -13,7 +13,7 @@ namespace Ergebnis\PhpCsFixer\Config\Test\Unit\RuleSet; -use Ergebnis\PhpCsFixer\Config; +use Ergebnis\PhpCsFixer\Config\RuleSet; use PhpCsFixer\Fixer; use PhpCsFixer\FixerConfiguration; use PhpCsFixer\FixerFactory; @@ -347,7 +347,7 @@ final protected static function className(): string /** * @throws \RuntimeException */ - final protected static function createRuleSet(?string $header = null): Config\RuleSet + final protected static function createRuleSet(?string $header = null): RuleSet { $className = self::className(); @@ -355,11 +355,11 @@ final protected static function createRuleSet(?string $header = null): Config\Ru $ruleSet = $reflection->newInstance($header); - if (!$ruleSet instanceof Config\RuleSet) { + if (!$ruleSet instanceof RuleSet) { throw new \RuntimeException(\sprintf( 'Class %s" does not implement interface "%s".', $className, - Config\RuleSet::class, + RuleSet::class, )); } diff --git a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php index b3ccff7c..64b976c4 100644 --- a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php +++ b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php @@ -13,7 +13,7 @@ namespace Ergebnis\PhpCsFixer\Config\Test\Unit\RuleSet; -use Ergebnis\PhpCsFixer\Config; +use Ergebnis\PhpCsFixer\Config\RuleSet; use PhpCsFixer\Fixer; use PhpCsFixer\FixerConfiguration; @@ -26,7 +26,7 @@ final public function testIsExplicitRuleSet(): void { $ruleSet = self::createRuleSet(); - self::assertInstanceOf(Config\RuleSet\ExplicitRuleSet::class, $ruleSet); + self::assertInstanceOf(RuleSet\ExplicitRuleSet::class, $ruleSet); } final public function testRuleSetDoesNotConfigureRuleSets(): void