diff --git a/src/Console/Command/Info/RequirementsCommand.php b/src/Console/Command/Info/RequirementsCommand.php index a575fb2b6..5270915c9 100644 --- a/src/Console/Command/Info/RequirementsCommand.php +++ b/src/Console/Command/Info/RequirementsCommand.php @@ -36,7 +36,6 @@ use function is_array; use function iter\filter; use function iter\toArray; -use function sprintf; final readonly class RequirementsCommand implements Command { @@ -129,8 +128,7 @@ private function getAllRequirements( ComposerJson $composerJson, ComposerLock $composerLock, Configuration $config, - ): array - { + ): array { $requirements = $this->factory->createUnfiltered( $composerJson, $composerLock, @@ -147,8 +145,7 @@ private function getOptimizedExtensionRequirements( ComposerJson $composerJson, ComposerLock $composerLock, Configuration $config, - ): array - { + ): array { $optimizedRequirements = $this->factory->create( $composerJson, $composerLock, @@ -201,7 +198,7 @@ private static function filterRequirements(RequirementsCollection $requirements) */ private static function renderRequiredPHPVersionsSection( array $requirements, - IO $io, + IO $io, ): void { if (0 === count($requirements)) { $io->writeln('No PHP constraint found.'); @@ -318,8 +315,7 @@ private static function renderTable( IO $io, array $headers, array|TableSeparator ...$rowsList, - ): void - { + ): void { /** @var Table $table */ $table = $io->createTable(); $table->setStyle('box'); diff --git a/tests/Console/Command/Info/RequirementsCommandTest.php b/tests/Console/Command/Info/RequirementsCommandTest.php index dbdf3b686..62653ef4d 100644 --- a/tests/Console/Command/Info/RequirementsCommandTest.php +++ b/tests/Console/Command/Info/RequirementsCommandTest.php @@ -15,7 +15,7 @@ namespace Console\Command\Info; use Fidry\Console\Test\CommandTester; -use KevinGH\Box\Console\Command\Info\RequirementsCommand as RequirementsCommand; +use KevinGH\Box\Console\Command\Info\RequirementsCommand; use KevinGH\Box\RequirementChecker\AppRequirementsFactory; use KevinGH\Box\RequirementChecker\Requirement; use KevinGH\Box\RequirementChecker\Requirements; @@ -74,16 +74,16 @@ public static function requirementsProvider(): iterable new Requirements([]), new Requirements([]), <<<'OUTPUT' - No PHP constraint found. + No PHP constraint found. - No extension constraint found. + No extension constraint found. - The required and provided extensions constraints (see above) are resolved to compute the final required extensions. - The application does not have any extension constraint. + The required and provided extensions constraints (see above) are resolved to compute the final required extensions. + The application does not have any extension constraint. - No conflicting extension found. + No conflicting extension found. - OUTPUT, + OUTPUT, ]; yield 'a real case' => [ @@ -103,41 +103,41 @@ public static function requirementsProvider(): iterable Requirement::forConflictingExtension('phar', 'package1'), ]), <<<'OUTPUT' - The following PHP constraints were found: - ┌─────────────┬────────┐ - │ Constraints │ Source │ - ├─────────────┼────────┤ - │ >=7.2 │ root │ - └─────────────┴────────┘ - - The following extensions constraints were found: - ┌──────────┬───────────┬──────────┐ - │ Type │ Extension │ Source │ - ├──────────┼───────────┼──────────┤ - │ required │ http │ package1 │ - │ required │ http │ package2 │ - │ provided │ http │ root │ - │ required │ openssl │ package1 │ - │ provided │ zip │ root │ - └──────────┴───────────┴──────────┘ - - The required and provided extensions constraints (see above) are resolved to compute the final required extensions. - The application requires the following extension constraints: - ┌───────────┬──────────┐ - │ Extension │ Source │ - ├───────────┼──────────┤ - │ openssl │ package1 │ - └───────────┴──────────┘ - - Conflicting extensions: - ┌───────────┬──────────┐ - │ Extension │ Source │ - ├───────────┼──────────┤ - │ openssl │ package3 │ - │ phar │ package1 │ - └───────────┴──────────┘ - - OUTPUT, + The following PHP constraints were found: + ┌─────────────┬────────┐ + │ Constraints │ Source │ + ├─────────────┼────────┤ + │ >=7.2 │ root │ + └─────────────┴────────┘ + + The following extensions constraints were found: + ┌──────────┬───────────┬──────────┐ + │ Type │ Extension │ Source │ + ├──────────┼───────────┼──────────┤ + │ required │ http │ package1 │ + │ required │ http │ package2 │ + │ provided │ http │ root │ + │ required │ openssl │ package1 │ + │ provided │ zip │ root │ + └──────────┴───────────┴──────────┘ + + The required and provided extensions constraints (see above) are resolved to compute the final required extensions. + The application requires the following extension constraints: + ┌───────────┬──────────┐ + │ Extension │ Source │ + ├───────────┼──────────┤ + │ openssl │ package1 │ + └───────────┴──────────┘ + + Conflicting extensions: + ┌───────────┬──────────┐ + │ Extension │ Source │ + ├───────────┼──────────┤ + │ openssl │ package3 │ + │ phar │ package1 │ + └───────────┴──────────┘ + + OUTPUT, ]; } }