protected function extractRepositoryInformation($sourceUrl)
    {
        $pattern = '#' . $this->getDomain() . '/' . self::REGEX_USER . '/' . self::REGEX_REPOSITORY . '#';

        preg_match($pattern, $sourceUrl, $matches);

        if (!isset($matches['user']) || !isset($matches['repository'])) {
            throw new \LogicException(
                sprintf('Unrecognized url format for %s ("%s")', $this->getDomain(), $sourceUrl)
            );
        }

        return [
            'user' => $matches['user'],
            'repository' => $matches['repository'],
        ];
    }
protected function extractRepositoryInformation($sourceUrl)
    {
        $pattern = '#' . $this->getDomain() . '/' . self::REGEX_USER . '/' . self::REGEX_REPOSITORY . '#';

        preg_match($pattern, $sourceUrl, $matches);

        if (!isset($matches['user']) || !isset($matches['repository'])) {
            throw new \LogicException(
                sprintf('Unrecognized url format for %s ("%s")', $this->getDomain(), $sourceUrl)
            );
        }

        return [
            'user' => $matches['user'],
            'repository' => $matches['repository'],
        ];
    }
protected function extractRepositoryInformation ( $ sourceUrl ) { $ pattern = '#' . $ this -> getDomain ( ) . '/' . self :: REGEX_USER . '/' . self :: REGEX_REPOSITORY . '#' ; preg_match ( $ pattern , $ sourceUrl , $ matches ) ; if ( ! isset ( $ matches [ 'user' ] ) || ! isset ( $ matches [ 'repository' ] ) ) { throw new \ LogicException ( sprintf ( 'Unrecognized url format for %s ("%s")' , $ this -> getDomain ( ) , $ sourceUrl ) ) ; } return [ 'user' => $ matches [ 'user' ] , 'repository' => $ matches [ 'repository' ] , ] ; }
Extracts information like user and repository from the http url.

@param string $sourceUrl

@return array
Extracts information like user and repository from the http url .