Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Mar 12, 2024
1 parent 6690364 commit baa821c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 50 deletions.
12 changes: 4 additions & 8 deletions src/Console/Command/Info/RequirementsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -129,8 +128,7 @@ private function getAllRequirements(
ComposerJson $composerJson,
ComposerLock $composerLock,
Configuration $config,
): array
{
): array {
$requirements = $this->factory->createUnfiltered(
$composerJson,
$composerLock,
Expand All @@ -147,8 +145,7 @@ private function getOptimizedExtensionRequirements(
ComposerJson $composerJson,
ComposerLock $composerLock,
Configuration $config,
): array
{
): array {
$optimizedRequirements = $this->factory->create(
$composerJson,
$composerLock,
Expand Down Expand Up @@ -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('<comment>No PHP constraint found.</comment>');
Expand Down Expand Up @@ -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');
Expand Down
84 changes: 42 additions & 42 deletions tests/Console/Command/Info/RequirementsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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' => [
Expand All @@ -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,
];
}
}

0 comments on commit baa821c

Please sign in to comment.