Fragen\GitHub_Updater\Additions::add_headers PHP Method

add_headers() public method

Add GitHub Updater headers to plugins/themes via a filter hooks.
public add_headers ( $config, $repos, $type )
$config
$repos
$type
    public function add_headers($config, $repos, $type)
    {
        $this->add_to_github_updater = array();
        foreach ($config as $repo) {
            // Continue if repo not installed.
            if (!array_key_exists($repo['slug'], $repos)) {
                continue;
            }
            $addition = array();
            $additions[$repo['slug']] = array();
            if ('plugin' === $type) {
                $additions[$repo['slug']] = $repos[$repo['slug']];
            }
            switch ($repo['type']) {
                case 'github_plugin':
                case 'github_theme':
                    $addition['slug'] = $repo['slug'];
                    $addition['GitHub ' . ucwords($type) . ' URI'] = $repo['uri'];
                    break;
                case 'bitbucket_plugin':
                case 'bitbucket_theme':
                    $addition['slug'] = $repo['slug'];
                    $addition['Bitbucket ' . ucwords($type) . ' URI'] = $repo['uri'];
                    break;
                case 'gitlab_plugin':
                case 'gitlab_theme':
                    $addition['slug'] = $repo['slug'];
                    $addition['GitLab ' . ucwords($type) . ' URI'] = $repo['uri'];
                    break;
            }
            $this->add_to_github_updater[$repo['slug']] = array_merge($additions[$repo['slug']], $addition);
        }
    }