Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"require-dev": {
"ext-openssl": "*",
"behat/behat": "^3.24.1",
"bnf/phpstan-psr-container": "^1.1",
"doctrine/coding-standard": "^14.0.0",
"phpstan/phpstan": "^2.1.29",
"phpunit/phpunit": "^10.5.58"
Expand Down
59 changes: 58 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 0 additions & 144 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,6 @@ parameters:
count: 1
path: src/Command/UninstallCommand.php

-
message: '#^Binary operation "\." between ''Found prebuilt…'' and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/ComposerIntegration/Listeners/OverrideDownloadUrlInstallListener.php

-
message: '#^Cannot call method findMatchingReleaseAssetUrl\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: src/ComposerIntegration/Listeners/OverrideDownloadUrlInstallListener.php

-
message: '#^Parameter \#1 \$path of function pathinfo expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/Listeners/OverrideDownloadUrlInstallListener.php

-
message: '#^Parameter \#1 \$url of method Composer\\Package\\PackageInterface\:\:setDistUrl\(\) expects string\|null, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/Listeners/OverrideDownloadUrlInstallListener.php

-
message: '#^Call to function assert\(\) with true will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand All @@ -126,36 +102,6 @@ parameters:
count: 1
path: src/ComposerIntegration/MinimalHelperSet.php

-
message: '#^Cannot call method loadConfiguration\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: src/ComposerIntegration/PieComposerFactory.php

-
message: '#^Parameter \#1 \$io of method Composer\\Factory\:\:createComposer\(\) expects Composer\\IO\\IOInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/PieComposerFactory.php

-
message: '#^Parameter \#2 \$io of static method Php\\Pie\\ComposerIntegration\\Listeners\\OverrideDownloadUrlInstallListener\:\:selfRegister\(\) expects Composer\\IO\\IOInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/PieComposerFactory.php

-
message: '#^Parameter \#5 \$installAndBuildProcess of class Php\\Pie\\ComposerIntegration\\PiePackageInstaller constructor expects Php\\Pie\\ComposerIntegration\\InstallAndBuildProcess, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/PieComposerFactory.php

-
message: '#^Parameter \#6 \$uninstallProcess of class Php\\Pie\\ComposerIntegration\\PiePackageInstaller constructor expects Php\\Pie\\ComposerIntegration\\UninstallProcess, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ComposerIntegration/PieComposerFactory.php

-
message: '#^Parameter \#3 \$package of class Php\\Pie\\ComposerIntegration\\PieComposerInstaller constructor expects Composer\\Package\\BasePackage&Composer\\Package\\RootPackageInterface, Composer\\Package\\RootPackageInterface given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -210,42 +156,12 @@ parameters:
count: 1
path: src/ComposerIntegration/VendorCleanup.php

-
message: '#^Anonymous function should return Php\\Pie\\Building\\Build but returns mixed\.$#'
identifier: return.type
count: 2
path: src/Container.php

-
message: '#^Anonymous function should return Php\\Pie\\Installing\\Install but returns mixed\.$#'
identifier: return.type
count: 2
path: src/Container.php

-
message: '#^Parameter \#1 \$implementation of method Illuminate\\Contracts\\Container\\ContextualBindingBuilder\:\:give\(\) expects array\|Closure\|string, non\-empty\-string\|false given\.$#'
identifier: argument.type
count: 1
path: src/Container.php

-
message: '#^Parameter \#1 \$input of class Php\\Pie\\ComposerIntegration\\QuieterConsoleIO constructor expects Symfony\\Component\\Console\\Input\\InputInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Container.php

-
message: '#^Parameter \#1 \$possibleApproaches of class Php\\Pie\\Installing\\Ini\\PickBestSetupIniApproach constructor expects list\<Php\\Pie\\Installing\\Ini\\SetupIniApproach\>, array\{mixed, mixed, mixed, mixed, mixed\} given\.$#'
identifier: argument.type
count: 1
path: src/Container.php

-
message: '#^Parameter \#2 \$output of class Php\\Pie\\ComposerIntegration\\QuieterConsoleIO constructor expects Symfony\\Component\\Console\\Output\\OutputInterface, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Container.php

-
message: '#^Call to static method Php\\Pie\\DependencyResolver\\DetermineMinimumStability\:\:assertValidStabilityString\(\) with ''alpha''\|''beta''\|''dev''\|''RC''\|''stable'' will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
Expand Down Expand Up @@ -456,24 +372,6 @@ parameters:
count: 2
path: test/integration/Building/UnixBuildTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 1
path: test/integration/Command/BuildCommandTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 1
path: test/integration/Command/DownloadCommandTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 1
path: test/integration/Command/InfoCommandTest.php

-
message: '#^Call to function array_key_exists\(\) with 1 and array\{non\-falsy\-string, string\} will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand All @@ -492,12 +390,6 @@ parameters:
count: 1
path: test/integration/Command/InstallCommandTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 1
path: test/integration/Command/InstallCommandTest.php

-
message: '#^Parameter \#1 \$originalClassName of method PHPUnit\\Framework\\TestCase\:\:createMock\(\) expects class\-string\<object\>, string given\.$#'
identifier: argument.type
Expand All @@ -510,42 +402,6 @@ parameters:
count: 1
path: test/integration/Command/InstallExtensionsForProjectCommandTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 3
path: test/integration/Command/RepositoryManagementCommandsTest.php

-
message: '#^Parameter \#1 \$command of class Symfony\\Component\\Console\\Tester\\CommandTester constructor expects Symfony\\Component\\Console\\Command\\Command, mixed given\.$#'
identifier: argument.type
count: 2
path: test/integration/Command/ShowCommandTest.php

-
message: '#^Cannot call method __invoke\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: test/integration/DependencyResolver/ResolveDependencyWithComposerTest.php

-
message: '#^Cannot call method downloadUrl\(\) on mixed\.$#'
identifier: method.nonObject
count: 2
path: test/integration/DependencyResolver/ResolveDependencyWithComposerTest.php

-
message: '#^Cannot call method version\(\) on mixed\.$#'
identifier: method.nonObject
count: 1
path: test/integration/DependencyResolver/ResolveDependencyWithComposerTest.php

-
message: '#^Parameter \#2 \$string of static method PHPUnit\\Framework\\Assert\:\:assertStringMatchesFormat\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: test/integration/DependencyResolver/ResolveDependencyWithComposerTest.php

-
message: '#^Call to function assert\(\) with true will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- phpstan-baseline.neon
- vendor/bnf/phpstan-psr-container/extension.neon

parameters:
level: 10
Expand Down
23 changes: 18 additions & 5 deletions src/Command/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,37 @@ function (string $version, string $phpExtensionName) use ($composer, $rootPackag
Assert::stringNotEmpty($packageName);
Assert::stringNotEmpty($packageRequirement);

$latestPackage = ($this->resolveDependencyWithComposer)(
$latestConstrainedPackage = ($this->resolveDependencyWithComposer)(
$composer,
$targetPlatform,
new RequestedPackageAndVersion($packageName, $packageRequirement),
false,
);

$latestPackage = ($this->resolveDependencyWithComposer)(
$composer,
$targetPlatform,
new RequestedPackageAndVersion($packageName, '*'),
false,
);
} catch (UnableToResolveRequirement | BundledPhpExtensionRefusal) {
$latestPackage = null;
$latestConstrainedPackage = null;
$latestPackage = null;
}

$updateNotice = '';
if ($latestPackage !== null && $latestPackage->version() !== $piePackage->version()) {
if ($latestConstrainedPackage !== null && $latestConstrainedPackage->version() !== $piePackage->version()) {
$updateNotice = sprintf(
' — new version %s available',
$latestPackage->version(),
', upgradable to %s (within %s)',
$latestConstrainedPackage->version(),
$packageRequirement,
);
}

if ($latestPackage !== null && $latestPackage->version() !== $latestConstrainedPackage->version()) {
$updateNotice .= sprintf(', latest version is %s', $latestPackage->version());
}

$output->writeln(sprintf(
' <info>%s:%s</info> (from 🥧 <info>%s</info>%s)%s',
$phpExtensionName,
Expand Down
Loading