Skip to content

Commit

Permalink
bug #509 Fix dealing with locally patched packages (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.2-dev branch.

Discussion
----------

Fix dealing with locally patched packages

Fixes #508
Happens on the CI when local packages are built for testing PRs.

Commits
-------

42bdc9f Fix dealing with locally patched packages
  • Loading branch information
fabpot committed Jun 5, 2019
2 parents bc7390d + 42bdc9f commit 408f045
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function read($file)

public function removeLegacyTags(array $data): array
{
if (!$this->symfonyConstraints) {
if (!$this->symfonyConstraints || !isset($data['packages'])) {
return $data;
}

Expand All @@ -78,6 +78,8 @@ public function removeLegacyTags(array $data): array
foreach ($versions as $version => $composerJson) {
if ('dev-master' === $version) {
$normalizedVersion = $this->versionParser->normalize($devMasterAlias);
} elseif (!isset($composerJson['version_normalized'])) {
continue;
} else {
$normalizedVersion = $composerJson['version_normalized'];
}
Expand All @@ -97,6 +99,8 @@ public function removeLegacyTags(array $data): array
foreach ($symfonySymfony as $version => $composerJson) {
if ('dev-master' === $version) {
$normalizedVersion = $this->versionParser->normalize($composerJson['extra']['branch-alias']['dev-master']);
} elseif (!isset($composerJson['version_normalized'])) {
continue;
} else {
$normalizedVersion = $composerJson['version_normalized'];
}
Expand Down

0 comments on commit 408f045

Please sign in to comment.