public function getGitHubUrlInfo()
    {
        $info = $this->getGithubInfo();

        if (isset($info['url'])) {
            $matches = [];
            $pattern = '/(?:https?:\/\/github.com\/|git\@.+\:)([\w\/\-\_]+)/';

            if (preg_match($pattern, $info['url'], $matches)) {
                list($account, $repo) = explode(
                    DIRECTORY_SEPARATOR,
                    $matches[1]
                );

                return [
                    'account' => $account,
                    'repository' => $repo,
                ];
            }
        }

        return [];
    }
public function getGitHubUrlInfo()
    {
        $info = $this->getGithubInfo();

        if (isset($info['url'])) {
            $matches = [];
            $pattern = '/(?:https?:\/\/github.com\/|git\@.+\:)([\w\/\-\_]+)/';

            if (preg_match($pattern, $info['url'], $matches)) {
                list($account, $repo) = explode(
                    DIRECTORY_SEPARATOR,
                    $matches[1]
                );

                return [
                    'account' => $account,
                    'repository' => $repo,
                ];
            }
        }

        return [];
    }
public function getGitHubUrlInfo ( ) { $ info = $ this -> getGithubInfo ( ) ; if ( isset ( $ info [ 'url' ] ) ) { $ matches = [ ] ; $ pattern = '/(?:https?:\/\/github.com\/|git\@.+\:)([\w\/\-\_]+)/' ; if ( preg_match ( $ pattern , $ info [ 'url' ] , $ matches ) ) { list ( $ account , $ repo ) = explode ( DIRECTORY_SEPARATOR , $ matches [ 1 ] ) ; return [ 'account' => $ account , 'repository' => $ repo , ] ; } } return [ ] ; }
Get GitHub information for URL.

@return array
An array of account and repository values.
Get GitHub information for URL .