1
0
Fork 0

Fail hard if an invalid root alias is detected

pull/9197/head
Jordi Boggiano 2020-09-09 11:44:05 +02:00
parent d61c1ccb7c
commit 4a02768591
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 0 deletions

View File

@ -190,6 +190,8 @@ class RootPackageLoader extends ArrayLoader
'alias' => $match[2],
'alias_normalized' => $this->versionParser->normalize($match[2], $reqVersion),
);
} elseif (strpos($reqVersion, ' as ') !== false) {
throw new \UnexpectedValueException('Invalid alias definition in "'.$reqName.'": "'.$reqVersion.'". Aliases should be in the form "exact-version as other-exact-version".');
}
}