Documentation

Git
in package

Table of Contents

getRepositoryState()  : string|null
Returns the git hash of the currently checked out head of the given repository, or null on failure.
getRepositoryStatePretty()  : string
Infallible, returns a string representing git state, or a string of zeros on failure.
__construct()  : mixed

Methods

getRepositoryState()

Returns the git hash of the currently checked out head of the given repository, or null on failure.

public static getRepositoryState(string $dir, bool &$dirty) : string|null
Parameters
$dir : string
$dirty : bool

reference parameter, set to whether the repo has local changes

Return values
string|null

getRepositoryStatePretty()

Infallible, returns a string representing git state, or a string of zeros on failure.

public static getRepositoryStatePretty(string $dir) : string

If the repo is dirty, a "-dirty" suffix is added.

Parameters
$dir : string
Return values
string

__construct()

private __construct() : mixed
Return values
mixed

Search results