Skip to content

Commit

Permalink
Update deps and baseline (1663, 96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 19, 2024
1 parent 61e2d24 commit 504e6c5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 87 deletions.
36 changes: 18 additions & 18 deletions composer.lock

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

7 changes: 1 addition & 6 deletions phpstan/baseline-8.1.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ parameters:
count: 1
path: ../src/Composer/Command/ArchiveCommand.php

-
message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Command/ConfigCommand.php

-
message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Config\\\\JsonConfigSource, string\\} given\\.$#"
count: 2
Expand Down Expand Up @@ -131,7 +126,7 @@ parameters:
path: ../src/Composer/Package/Archiver/PharArchiver.php

-
message: "#^Parameter \\#1 \\$array of function ksort expects array, array\\<int\\|string, mixed\\>\\|string given\\.$#"
message: "#^Parameter \\#1 \\$array of function ksort expects array, array\\|string given\\.$#"
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

Expand Down
56 changes: 3 additions & 53 deletions phpstan/baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ parameters:
path: ../src/Composer/Command/ConfigCommand.php

-
message: "#^Only booleans are allowed in an if condition, string given\\.$#"
message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Command/ConfigCommand.php

Expand Down Expand Up @@ -1135,11 +1135,6 @@ parameters:
count: 1
path: ../src/Composer/DependencyResolver/GenericRule.php

-
message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#"
count: 1
path: ../src/Composer/DependencyResolver/LockTransaction.php

-
message: "#^Cannot access offset 'hash' on array\\|false\\.$#"
count: 1
Expand Down Expand Up @@ -2385,11 +2380,6 @@ parameters:
count: 1
path: ../src/Composer/Installer/SuggestedPackagesReporter.php

-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 2
path: ../src/Composer/Installer/SuggestedPackagesReporter.php

-
message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#"
count: 2
Expand Down Expand Up @@ -2600,28 +2590,18 @@ parameters:
count: 2
path: ../src/Composer/Package/Dumper/ArrayDumper.php

-
message: "#^Only booleans are allowed in an if condition, array\\<string, string\\> given\\.$#"
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

-
message: "#^Only booleans are allowed in an if condition, array\\<string\\> given\\.$#"
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

-
message: "#^Only booleans are allowed in an if condition, string given\\.$#"
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

-
message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#"
count: 4
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

-
message: "#^Parameter \\#1 \\$array_arg of function ksort expects array, array\\<int\\|string, mixed\\>\\|string given\\.$#"
message: "#^Parameter \\#1 \\$array_arg of function ksort expects array, array\\|string given\\.$#"
count: 1
path: ../src/Composer/Package/Dumper/ArrayDumper.php

Expand Down Expand Up @@ -2705,21 +2685,6 @@ parameters:
count: 2
path: ../src/Composer/Package/Loader/RootPackageLoader.php

-
message: "#^Parameter \\#1 \\$requires of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractAliases\\(\\) expects array\\<string, string\\>, array\\<int\\|string, mixed\\> given\\.$#"
count: 1
path: ../src/Composer/Package/Loader/RootPackageLoader.php

-
message: "#^Parameter \\#1 \\$requires of static method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractReferences\\(\\) expects array\\<string, string\\>, array\\<int\\|string, mixed\\> given\\.$#"
count: 1
path: ../src/Composer/Package/Loader/RootPackageLoader.php

-
message: "#^Parameter \\#1 \\$requires of static method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractStabilityFlags\\(\\) expects array\\<string, string\\>, array\\<int\\|string, mixed\\> given\\.$#"
count: 1
path: ../src/Composer/Package/Loader/RootPackageLoader.php

-
message: "#^Parameter \\#2 \\$class \\(class\\-string\\<Composer\\\\Package\\\\RootPackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\<Composer\\\\Package\\\\CompletePackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:load\\(\\)$#"
count: 1
Expand Down Expand Up @@ -3090,16 +3055,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/ComposerRepository.php

-
message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviders\\(\\) should return array\\<string, array\\{name\\: string, description\\: string, type\\: string\\}\\> but returns array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/ComposerRepository.php

-
message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:whatProvides\\(\\) should return array\\<string, Composer\\\\Package\\\\BasePackage\\> but returns array\\<int\\|string, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\>\\.$#"
count: 1
path: ../src/Composer/Repository/ComposerRepository.php

-
message: "#^Only booleans are allowed in &&, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given on the left side\\.$#"
count: 1
Expand Down Expand Up @@ -4473,11 +4428,6 @@ parameters:
count: 1
path: ../src/Composer/Util/NoProxyPattern.php

-
message: "#^Method Composer\\\\Util\\\\NoProxyPattern\\:\\:ipCheckData\\(\\) never assigns null to &\\$ipdata so it can be removed from the by\\-ref type\\.$#"
count: 1
path: ../src/Composer/Util/NoProxyPattern.php

-
message: "#^Only booleans are allowed in a negated boolean, bool\\|stdClass given\\.$#"
count: 1
Expand Down
23 changes: 13 additions & 10 deletions src/Composer/Package/Dumper/ArrayDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function dump(PackageInterface $package): array
$data['version'] = $package->getPrettyVersion();
$data['version_normalized'] = $package->getVersion();

if ($package->getTargetDir()) {
if ($package->getTargetDir() !== null) {
$data['target-dir'] = $package->getTargetDir();
}

if ($package->getSourceType()) {
if ($package->getSourceType() !== null) {
$data['source']['type'] = $package->getSourceType();
$data['source']['url'] = $package->getSourceUrl();
if (null !== ($value = $package->getSourceReference())) {
Expand All @@ -59,7 +59,7 @@ public function dump(PackageInterface $package): array
}
}

if ($package->getDistType()) {
if ($package->getDistType() !== null) {
$data['dist']['type'] = $package->getDistType();
$data['dist']['url'] = $package->getDistUrl();
if (null !== ($value = $package->getDistReference())) {
Expand All @@ -74,15 +74,18 @@ public function dump(PackageInterface $package): array
}

foreach (BasePackage::$supportedLinkTypes as $type => $opts) {
if ($links = $package->{'get'.ucfirst($opts['method'])}()) {
foreach ($links as $link) {
$data[$type][$link->getTarget()] = $link->getPrettyConstraint();
}
ksort($data[$type]);
$links = $package->{'get'.ucfirst($opts['method'])}();
if (\count($links) === 0) {
continue;
}
foreach ($links as $link) {
$data[$type][$link->getTarget()] = $link->getPrettyConstraint();
}
ksort($data[$type]);
}

if ($packages = $package->getSuggests()) {
$packages = $package->getSuggests();
if (\count($packages) > 0) {
ksort($packages);
$data['suggest'] = $packages;
}
Expand Down Expand Up @@ -130,7 +133,7 @@ public function dump(PackageInterface $package): array

if ($package instanceof RootPackageInterface) {
$minimumStability = $package->getMinimumStability();
if ($minimumStability) {
if ($minimumStability !== '') {
$data['minimum-stability'] = $minimumStability;
}
}
Expand Down

0 comments on commit 504e6c5

Please sign in to comment.