Report validation error if a package replaces and conflicts against the same name, fixes #9845

main
Jordi Boggiano 3 years ago
parent c15eba3fe3
commit deaec7c0ac
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -281,6 +281,11 @@ class ValidatingArrayLoader implements LoaderInterface
$this->warnings[] = $linkType.'.'.$package.' : exact version constraints ('.$constraint.') should be avoided if the package follows semantic versioning';
}
}
if ($linkType === 'conflict' && isset($this->config['replace']) && $keys = array_intersect_key($this->config['replace'], $this->config['conflict'])) {
$this->errors[] = $linkType.'.'.$package.' : you cannot conflict with a package that is also replaced, as replace already creates an implicit conflict rule';
unset($this->config[$linkType][$package]);
}
}
}
}

Loading…
Cancel
Save