diff --git a/demo/composer.json b/demo/composer.json index 774d01417..45c9a584d 100644 --- a/demo/composer.json +++ b/demo/composer.json @@ -1,4 +1,8 @@ { + "require": { + "php": "^7.2", + "ext-json": "*" + }, "conflict": { "ext-aerospike": "*" } diff --git a/fixtures/info/req-checker-conflict.phar b/fixtures/info/req-checker-conflict.phar index d737c5b89..c9ee9ee01 100755 Binary files a/fixtures/info/req-checker-conflict.phar and b/fixtures/info/req-checker-conflict.phar differ diff --git a/fixtures/info/req-checker-ext-and-php-and-conflict.phar b/fixtures/info/req-checker-ext-and-php-and-conflict.phar index cdd5d81cf..221b53473 100755 Binary files a/fixtures/info/req-checker-ext-and-php-and-conflict.phar and b/fixtures/info/req-checker-ext-and-php-and-conflict.phar differ diff --git a/fixtures/info/req-checker-ext-and-php.phar b/fixtures/info/req-checker-ext-and-php.phar index 61684167d..453b71562 100755 Binary files a/fixtures/info/req-checker-ext-and-php.phar and b/fixtures/info/req-checker-ext-and-php.phar differ diff --git a/fixtures/info/req-checker-ext.phar b/fixtures/info/req-checker-ext.phar index edf7f906f..345bab6f3 100755 Binary files a/fixtures/info/req-checker-ext.phar and b/fixtures/info/req-checker-ext.phar differ diff --git a/fixtures/info/req-checker-php.phar b/fixtures/info/req-checker-php.phar index 68decf973..f444a51e2 100755 Binary files a/fixtures/info/req-checker-php.phar and b/fixtures/info/req-checker-php.phar differ diff --git a/src/Console/PharInfoRenderer.php b/src/Console/PharInfoRenderer.php index 7d83ebae7..179c1a1fc 100644 --- a/src/Console/PharInfoRenderer.php +++ b/src/Console/PharInfoRenderer.php @@ -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; @@ -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; @@ -245,7 +241,7 @@ static function ($carry, Requirement $requirement): array { $io->writeln(' Required:'); $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,