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);
}
}