PHP Class Pyrech\ComposerChangelogs\UrlGenerator\GitBasedUrlGenerator

Inheritance: implements Pyrech\ComposerChangelogs\UrlGenerator\UrlGenerator
Afficher le fichier Open project: pyrech/composer-changelogs

Méthodes publiques

Méthode Description
supports ( $sourceUrl )

Méthodes protégées

Méthode Description
extractRepositoryInformation ( string $sourceUrl ) : array Extracts information like user and repository from the http url.
generateBaseUrl ( string $sourceUrl ) : string Generates the canonical http url for a repository.
getCompareVersion ( Version $version ) : string Get the version to use for the compare url.
getDomain ( ) : string Returns the domain of the service, like "example.org".

Private Methods

Méthode Description
isSshUrl ( string $url ) : string Returns whether an url uses a ssh git protocol.
transformSshUrlIntoHttp ( string $url ) : string Transform an ssh git url into an http one.

Method Details

extractRepositoryInformation() protected méthode

Extracts information like user and repository from the http url.
protected extractRepositoryInformation ( string $sourceUrl ) : array
$sourceUrl string
Résultat array

generateBaseUrl() protected méthode

It ensures there is no .git part in http url. It also supports ssh urls by converting them in their http equivalent format.
protected generateBaseUrl ( string $sourceUrl ) : string
$sourceUrl string
Résultat string

getCompareVersion() protected méthode

For dev versions, it returns the commit short hash in full pretty version.
protected getCompareVersion ( Version $version ) : string
$version Pyrech\ComposerChangelogs\Version
Résultat string

getDomain() abstract protected méthode

Returns the domain of the service, like "example.org".
abstract protected getDomain ( ) : string
Résultat string

supports() public méthode

public supports ( $sourceUrl )