From d0216d8b3ea379ce65b8cb4d1721609a66acd14d Mon Sep 17 00:00:00 2001 From: Julien Falque Date: Thu, 27 Oct 2022 18:51:05 +0200 Subject: [PATCH] fixup! feature: Add `global_namespace_import` to @Symfony ruleset --- src/ConfigInterface.php | 5 ++--- src/Console/Command/ListFilesCommand.php | 3 +-- tests/FixerFactoryTest.php | 3 +-- tests/Tokenizer/Analyzer/AlternativeSyntaxAnalyzerTest.php | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/ConfigInterface.php b/src/ConfigInterface.php index e41fbf020b8..b46b191b018 100644 --- a/src/ConfigInterface.php +++ b/src/ConfigInterface.php @@ -15,7 +15,6 @@ namespace PhpCsFixer; use PhpCsFixer\Fixer\FixerInterface; -use SplFileInfo; /** * @author Fabien Potencier @@ -40,7 +39,7 @@ public function getCustomFixers(): array; /** * Returns files to scan. * - * @return iterable + * @return iterable<\SplFileInfo> */ public function getFinder(): iterable; @@ -103,7 +102,7 @@ public function registerCustomFixers(iterable $fixers): self; public function setCacheFile(string $cacheFile): self; /** - * @param iterable $finder + * @param iterable<\SplFileInfo> $finder */ public function setFinder(iterable $finder): self; diff --git a/src/Console/Command/ListFilesCommand.php b/src/Console/Command/ListFilesCommand.php index 1ce7454c04b..b92dae773e0 100644 --- a/src/Console/Command/ListFilesCommand.php +++ b/src/Console/Command/ListFilesCommand.php @@ -18,7 +18,6 @@ use PhpCsFixer\ConfigInterface; use PhpCsFixer\Console\ConfigurationResolver; use PhpCsFixer\ToolInfoInterface; -use SplFileInfo; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -81,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $finder = $resolver->getFinder(); - /** @var SplFileInfo $file */ + /** @var \SplFileInfo $file */ foreach ($finder as $file) { if ($file->isFile()) { $relativePath = str_replace($cwd, '.', $file->getRealPath()); diff --git a/tests/FixerFactoryTest.php b/tests/FixerFactoryTest.php index dbd761326be..8a21d1adeae 100644 --- a/tests/FixerFactoryTest.php +++ b/tests/FixerFactoryTest.php @@ -21,7 +21,6 @@ use PhpCsFixer\RuleSet\RuleSet; use PhpCsFixer\RuleSet\RuleSetInterface; use PhpCsFixer\WhitespacesFixerConfig; -use stdClass; /** * @author Dariusz RumiƄski @@ -375,7 +374,7 @@ public function provideConfigureFixerWithNonArrayCases(): array { return [ ['bar'], - [new stdClass()], + [new \stdClass()], [5], [5.5], ]; diff --git a/tests/Tokenizer/Analyzer/AlternativeSyntaxAnalyzerTest.php b/tests/Tokenizer/Analyzer/AlternativeSyntaxAnalyzerTest.php index bc0dae9aecb..e8270c1d672 100644 --- a/tests/Tokenizer/Analyzer/AlternativeSyntaxAnalyzerTest.php +++ b/tests/Tokenizer/Analyzer/AlternativeSyntaxAnalyzerTest.php @@ -14,7 +14,6 @@ namespace PhpCsFixer\Tests\Tokenizer\Analyzer; -use InvalidArgumentException; use PhpCsFixer\Tests\TestCase; use PhpCsFixer\Tokenizer\Analyzer\AlternativeSyntaxAnalyzer; use PhpCsFixer\Tokenizer\Tokens; @@ -190,7 +189,7 @@ public function testItThrowsOnInvalidAlternativeSyntaxBlockStartIndex(string $co $analyzer = new AlternativeSyntaxAnalyzer(); - $this->expectException(InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage($expectedMessage); $analyzer->findAlternativeSyntaxBlockEnd($tokens, $startIndex);