protected function archiveUrl(string $slug, string $type, string $version = ''): string
    {
        switch ($type) { // Based on dependency type.
            case 'plugin':
                if ($version) {
                    return 'https://downloads.wordpress.org/plugin/'.urlencode($slug).'.'.urlencode($version).'.zip';
                }
                return 'https://wordpress.org/plugins/'.urlencode($slug).'/developers/';

            case 'theme':
                if ($version) {
                    return 'https://downloads.wordpress.org/theme/'.urlencode($slug).'.'.urlencode($version).'.zip';
                }
                return 'https://themes.svn.wordpress.org/'.urlencode($slug).'/';

            default: // Default case handler.
                throw $this->c::issue('Unexpected type.');
        }
    }
protected function archiveUrl(string $slug, string $type, string $version = ''): string
    {
        switch ($type) { // Based on dependency type.
            case 'plugin':
                if ($version) {
                    return 'https://downloads.wordpress.org/plugin/'.urlencode($slug).'.'.urlencode($version).'.zip';
                }
                return 'https://wordpress.org/plugins/'.urlencode($slug).'/developers/';

            case 'theme':
                if ($version) {
                    return 'https://downloads.wordpress.org/theme/'.urlencode($slug).'.'.urlencode($version).'.zip';
                }
                return 'https://themes.svn.wordpress.org/'.urlencode($slug).'/';

            default: // Default case handler.
                throw $this->c::issue('Unexpected type.');
        }
    }
protected function archiveUrl ( string $ slug , string $ type , string $ version = '' ) : string { switch ( $ type ) { // Based on dependency type. case 'plugin' : if ( $ version ) { return 'https://downloads.wordpress.org/plugin/' . urlencode ( $ slug ) . '.' . urlencode ( $ version ) . '.zip' ; } return 'https://wordpress.org/plugins/' . urlencode ( $ slug ) . '/developers/' ; case 'theme' : if ( $ version ) { return 'https://downloads.wordpress.org/theme/' . urlencode ( $ slug ) . '.' . urlencode ( $ version ) . '.zip' ; } return 'https://themes.svn.wordpress.org/' . urlencode ( $ slug ) . '/' ; default : // Default case handler. throw $ this -> c :: issue ( 'Unexpected type.' ) ; } }
URL to dependency archive.

@since 160524 Plugin/theme dependencies.

@param string $slug    Dependency slug.
@param string $type    Dependency type.
@param string $version Specific version.

@return string URL to archive (or direct download if `$version` is given).
URL to dependency archive .