Skip to content

Commit

Permalink
ArrayLoader: assert that source/dist reference are string values
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubinix committed Mar 21, 2022
1 parent bd89a67 commit 76e577e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Composer/Package/Loader/ArrayLoader.php
Expand Up @@ -185,7 +185,7 @@ private function configureObject(PackageInterface $package, array $config): Base
}
$package->setSourceType($config['source']['type']);
$package->setSourceUrl($config['source']['url']);
$package->setSourceReference($config['source']['reference'] ?? null);
$package->setSourceReference(isset($config['source']['reference']) ? (string) $config['source']['reference'] : null);
if (isset($config['source']['mirrors'])) {
$package->setSourceMirrors($config['source']['mirrors']);
}
Expand All @@ -202,7 +202,7 @@ private function configureObject(PackageInterface $package, array $config): Base
}
$package->setDistType($config['dist']['type']);
$package->setDistUrl($config['dist']['url']);
$package->setDistReference($config['dist']['reference'] ?? null);
$package->setDistReference(isset($config['dist']['reference']) ? (string) $config['dist']['reference'] : null);
$package->setDistSha1Checksum($config['dist']['shasum'] ?? null);
if (isset($config['dist']['mirrors'])) {
$package->setDistMirrors($config['dist']['mirrors']);
Expand Down

0 comments on commit 76e577e

Please sign in to comment.