Skip to content

Commit

Permalink
Merge pull request #77 from siketyan/versioning/fix-composer-hash-null
Browse files Browse the repository at this point in the history
🐛 Fix failing to check composer.lock with path sources
  • Loading branch information
siketyan authored Dec 22, 2021
2 parents 1fc0965 + 93821d8 commit 5b1d0b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Scanner/Composer/ComposerLockParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function parse(?string $json): DependencyCollection
foreach ($packages as $package) {
$name = $package['name'];
$version = $package['version'];
$hash = $package['source']['reference'];
$hash = $package['dist']['reference'] ?? '';
$package = $this->packagePool->get($name);

if ($package === null) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Scanner/Composer/ComposerLockParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ComposerLockParserTest extends TestCase
{
"name": "foo/bar",
"version": "v1.2.3.4",
"source": {
"dist": {
"reference": "hash"
}
}
Expand All @@ -32,7 +32,7 @@ class ComposerLockParserTest extends TestCase
{
"name": "bar/baz",
"version": "3.2.1",
"source": {
"dist": {
"reference": "hash"
}
}
Expand Down

0 comments on commit 5b1d0b9

Please sign in to comment.