Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
theofidry committed Oct 22, 2023
1 parent 798bc0f commit 73786a9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions demo/composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"require": {
"php": "^7.2",
"ext-json": "*"
},
"conflict": {
"ext-aerospike": "*"
}
Expand Down
Binary file modified fixtures/info/req-checker-conflict.phar
Binary file not shown.
Binary file modified fixtures/info/req-checker-ext-and-php-and-conflict.phar
Binary file not shown.
Binary file modified fixtures/info/req-checker-ext-and-php.phar
Binary file not shown.
Binary file modified fixtures/info/req-checker-ext.phar
Binary file not shown.
Binary file modified fixtures/info/req-checker-php.phar
Binary file not shown.
16 changes: 6 additions & 10 deletions src/Console/PharInfoRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,9 @@ public static function renderTimestamp(PharInfo $pharInfo, IO $io): void
);
}

/**
* @param false|positive-int|0 $maxDepth
* @param false|int $indent Nbr of indent or `false`
*/
public static function renderRequirementChecker(
PharInfo $pharInfo,
IO $io,
IO $io,
): void {
$requirements = $pharInfo->getFiles()[self::BOX_REQUIREMENTS] ?? null;

Expand All @@ -221,17 +217,17 @@ public static function renderRequirementChecker(
$evaluatedRequirements,
);

if (count($evaluatedRequirements) === 0) {
if (0 === count($evaluatedRequirements)) {
$io->writeln(' No requirement found.');

return;
} else {
$io->writeln('');
}
$io->writeln('');

[$required, $conflicting] = array_reduce(
$evaluatedRequirements,
static function ($carry, Requirement $requirement): array {
if ($requirement->type === RequirementType::EXTENSION_CONFLICT) {
if (RequirementType::EXTENSION_CONFLICT === $requirement->type) {
$carry[1][] = $requirement;
} else {
$carry[0][] = $requirement;
Expand All @@ -245,7 +241,7 @@ static function ($carry, Requirement $requirement): array {
$io->writeln(' <comment>Required:</comment>');
$io->writeln(
array_map(
static fn (Requirement $requirement) => match($requirement->type) {
static fn (Requirement $requirement) => match ($requirement->type) {
RequirementType::PHP => sprintf(
' - PHP %s',
$requirement->condition,
Expand Down

0 comments on commit 73786a9

Please sign in to comment.