Fixed the scanner will missing the packages at require-dev of composer.json (#1223)

* Fix #686

* Update CHANGELOG.md
This commit is contained in:
黄朝晖 2020-01-05 02:07:50 +08:00 committed by GitHub
parent be471f537b
commit 0ebdb50a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# v1.1.14 - TBD
## Fixed
- [#1223](https://github.com/hyperf/hyperf/pull/1223) Fixed the scanner will missing the packages at require-dev of composer.json
# v1.1.13 - 2020-01-03
## Added

View File

@ -52,7 +52,9 @@ class Composer
throw new \RuntimeException('composer.lock not found.');
}
self::$content = collect(json_decode(file_get_contents($path), true));
foreach (self::$content->offsetGet('packages') ?? [] as $package) {
$packages = self::$content->offsetGet('packages') ?? [];
$packagesDev = self::$content->offsetGet('packages-dev') ?? [];
foreach (array_merge($packages, $packagesDev) as $package) {
$packageName = '';
foreach ($package ?? [] as $key => $value) {
if ($key === 'name') {