Skip to content

Commit

Permalink
Fix version constraint for PHP dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 20, 2017
1 parent 481c69b commit c0e0006
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/lib/Conductor/Package2XmlToComposer.php
Expand Up @@ -710,15 +710,19 @@ protected function getDepVersionString($req)
$req['exclude'][0] == $req['max'] &&
preg_match('/(\d)\.0\.0alpha1/', $req['max'], $version)) {
if (substr($req['min'], 0, 2) != ($version[1] - 1) . '.') {
$out[] = '<'.preg_replace('/(.0)*alpha1$/', '', $req['max']);
if ($req['dep'] == 'php') {
$out[] = '|| ^' . ($version[1] - 1);
} else {
$out[] = '<'.preg_replace('/(.0)*alpha1$/', '', $req['max']);
}
}
} else {
$out[] = '<='.$req['max'];
}
}

if (! empty($out)) {
$ret = join(',', $out);
$ret = join(' ', $out);
} else {
$ret = '*';
}
Expand Down

0 comments on commit c0e0006

Please sign in to comment.