MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

Commit

MMO\git\helpers · 1 symbole · générée le 27 Oct 2026

class

Commit

Commit.php:13

One commit, as Repository::log lists it.

class MMO\git\helpers\Commit implements JsonSerializable
Espace de noms
MMO\git\helpers
Implémente
JsonSerializable
foreach ($repo->log('v3.0.1..develop') as $commit) { echo $commit->short(), ' ', date('Y-m-d', $commit->time), ' ', $commit->subject, "\n"; }

Index

FORMATwhat Repository::log asks git log for: the fields of Parse, separated by a unit separator
author readonly
body readonly
email readonly
hash readonly
parents readonly
subject readonly
time readonly
isMerge()
jsonSerialize()
Parse($record) static
short($length)
__construct($hash, $parents, $author, $email, $time, $subject, $body)

Constantes1

FORMAT

what Repository::log asks git log for: the fields of Parse, separated by a unit separator

const FORMAT = '%H%x1f%P%x1f%an%x1f%ae%x1f%at%x1f%s%x1f%b'

Propriétés7

author

readonly
readonly string $author
Type
string

body

readonly
readonly string $body
Type
string

email

readonly
readonly string $email
Type
string

hash

readonly
readonly string $hash
Type
string

parents

readonly
readonly array $parents
Type
array

subject

readonly
readonly string $subject
Type
string

time

readonly
readonly int $time
Type
int

Méthodes5

short($length)

Commit.php:46
function short(int $length = 7): string
$length = 7int
retournestringits hash, shortened as git log --oneline would show it (7 characters)

__construct($hash, $parents, $author, $email, $time, $subject, $body)

Commit.php:26
function __construct( string $hash, array $parents, string $author, string $email, int $time, string $subject, string $body = '' )
$hashstringits full hash
$parentsarraytheir full hashes: none for a root commit, two or more for a merge
$authorstring
$emailstringthe author's
$timeintwhen it was authored (a unix timestamp)
$subjectstringthe first line of its message
$body = ''stringthe rest of its message