private function prepareGithubUrl($url) { $url = str_replace('http://', 'https://', $url); return ['name' => 'GitHub', 'basepath' => (strpos($url, 'https://github.com/') === 0 ? '' : 'https://github.com/') . trim($url, '/')]; }