Skip to content

Commit

Permalink
DEEP-9770 Filter dependencies which dont have metadata in composer.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
namandf committed Jan 23, 2024
1 parent e76752d commit cb7dd5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/php/composer/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ func (p *Parser) Parse(r dio.ReadSeekerAt) ([]types.Library, []types.Dependency,
p.populateDeps(lockFile.Packages, libs, foundDeps, false)
p.populateDeps(lockFile.DevPackages, libs, foundDeps, true)

// clean up deps with no metadata
// this is to handle cases where a package is part of require but we have not explicit entry with metadata for the same
for key, lib := range libs {
if len(lib.Name) == 0 {
delete(libs, key)
}
}

// fill deps versions
var deps []types.Dependency
for libID, depsOn := range foundDeps {
Expand Down

0 comments on commit cb7dd5a

Please sign in to comment.