Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Imports #549

Merged
merged 1 commit into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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