contao/monorepo-tools

Take Composer runtime API in account when sorting requirements

Closed this issue · 1 comments

m-vo commented

see contao/contao#3935 (comment)

We should probably adjust these:

uksort(
$requires,
static function ($a, $b) {
if ('php' === $a) {
return -1;
}
if ('php' === $b) {
return 1;
}
if (
(0 === strncmp($a, 'ext-', 4) && 0 !== strncmp($b, 'ext-', 4))
|| (0 === strncmp($a, 'lib-', 4) && 0 !== strncmp($b, 'lib-', 4))
) {
return -1;
}
if (
(0 !== strncmp($a, 'ext-', 4) && 0 === strncmp($b, 'ext-', 4))
|| (0 !== strncmp($a, 'lib-', 4) && 0 === strncmp($b, 'lib-', 4))
) {
return 1;
}
return strcmp($a, $b);
}
);

m-vo commented

Closing in favor of #19