Vanilla\Addon::convertRequire PHP Method

convertRequire() private static method

Convert the info array style requirements to the composer-like require format.
private static convertRequire ( array $info, array $keys )
$info array The addon info array.
$keys array The old requirement arrays.
    private static function convertRequire(array $info, array $keys)
    {
        $require = [];
        foreach ($keys as $key) {
            if (empty($info[$key]) || !is_array($info[$key])) {
                continue;
            }
            foreach ($info[$key] as $addonKey => $version) {
                if (!preg_match('`^[<>]=?|!=|~|\\^`', $version)) {
                    $version = '>=' . $version;
                }
                $require[strtolower($addonKey)] = $version;
            }
        }
        return $require;
    }