Skip to content

Commit

Permalink
Merge pull request #549 from ergebnis/fix/import
Browse files Browse the repository at this point in the history
Fix: Imports
  • Loading branch information
localheinz committed Jan 14, 2022
2 parents 59408a0 + 1cdc8f0 commit cc08e65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
15 changes: 8 additions & 7 deletions test/Unit/FactoryTest.php
Expand Up @@ -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;

Expand All @@ -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,
Expand All @@ -43,7 +44,7 @@ public function testFromRuleSetThrowsRuntimeExceptionIfCurrentPhpVersionIsLessTh
$targetPhpVersion,
));

Config\Factory::fromRuleSet($ruleSet);
Factory::fromRuleSet($ruleSet);
}

/**
Expand All @@ -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());
Expand Down Expand Up @@ -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,
Expand All @@ -107,7 +108,7 @@ public function testFromRuleSetCreatesConfigWithOverrideRules(): void
'foo' => false,
];

$config = Config\Factory::fromRuleSet(
$config = Factory::fromRuleSet(
$ruleSet,
$overrideRules,
);
Expand Down
8 changes: 4 additions & 4 deletions test/Unit/RuleSet/AbstractRuleSetTestCase.php
Expand Up @@ -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;
Expand Down Expand Up @@ -347,19 +347,19 @@ 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();

$reflection = new \ReflectionClass($className);

$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,
));
}

Expand Down
4 changes: 2 additions & 2 deletions test/Unit/RuleSet/ExplicitRuleSetTestCase.php
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit cc08e65

Please sign in to comment.