private function wpResolveVersionNo(string $versionContraint)
    {
        // Remove a v at the start if it exists
        $versionContraint = str_replace('v', '', $versionContraint);

        // If the constraint it a single wildcard, lets just
        // return the latest stable release of wordpress.
        if ($versionContraint == '*')
        {
            $json = (new Http)->request('GET', self::$WP_VERSION_URL)->getBody();
            return json_decode($json, true)['offers'][0]['version'];
        }

        // Download the releases from the wordpress site.
        $html = (new Http)->request('GET', self::$WP_RELEASES_URL)->getBody()->getContents();

        // Extract a list of download links, these contain the versions.
        preg_match_all("#><a href='https://wordpress\.org/wordpress-[^>]+#",
            $html, $matches
        );

        // Filter the links to obtain a list of just versions
        $versions = Linq::from($matches[0])
        ->select(function(string $v){ return Str::s($v); })
        ->where(function(Str $v){ return $v->endsWith(".zip'"); })
        ->where(function(Str $v){ return !$v->contains('IIS'); })
        ->where(function(Str $v){ return !$v->contains('mu'); })
        ->select(function(Str $v){ return $v->between('wordpress-', '.zip'); })
        ->where(function(Str $v)
        {
            if ($v->contains('-'))
            {
                return preg_match("#.*-(dev|beta|alpha|rc).*#i", (string)$v) === 1;
            }

            return true;
        })
        ->toArray();

        // Let semver take over and work it's magic
        return (string) Semver::satisfiedBy($versions, $versionContraint)[0];
    }