Index

aEntry

MMO\git\classes · 1 symbol · generated 5 Oct 2026

class

aEntry

aEntry.php:14

Anything git status can report on: a file (File), a submodule (Module) or the repository itself (Repository).

abstract class MMO\git\classes\aEntry implements MMO\git\interfaces\iEntry
Namespace
MMO\git\classes
Implements
iEntry
An entry carries an absolute filename, a bitmask of [`iEntry`](https://mcp.mmoframework.fr/documentation/mmo.git/php/interfaces/iEntry.md#ientry) flags, and -- when git reported a rename or a copy -- the path it came from.

Index

filename
origin
parent
status
STATUS_TEXT static
addStatus($flags)
clearStatus($flags)
debugName()
getFilename()
getOrigin()
getParent()
getStatus()
getStatusText($sep)
relativeFilename()The filename relative to the repository this entry belongs to.
setOrigin($origin)
setParent($parent)
setStatus($flags, $origin)Replace the status flags, and -- because git reports a rename's previous path alongside its status -- optionally the origin in the same call.
StatusFlags($flags) staticRead the two-character <XY> field of a git status --porcelain=2 entry.
StatusModuleFlags($flags) staticRead the four-character <sub> field of a git status --porcelain=2 entry (N... for a plain file, S<c><m><u> for a submodule).
StatusText($status, $sep) staticConvert git status constants to text.
__construct($filename, $status, $origin)

Properties5

filename

protected string $filename = ''
Type
string

origin

protected ?string $origin = null
Type
null | string

parent

protected ?MMO\git\helpers\Repository $parent = null
Type
null | Repository

status

protected int $status = 0
Type
int

STATUS_TEXT

static
static array $STATUS_TEXT = […20 items]
Type
array

Methods16

relativeFilename()

aEntry.php:70

The filename relative to the repository this entry belongs to. A standalone repository, having no parent, is its own root and answers with its absolute filename.

function relativeFilename(): string
returnsstring

setStatus($flags, $origin)

aEntry.php:110

Replace the status flags, and -- because git reports a rename's previous path alongside its status -- optionally the origin in the same call.

function setStatus(int $flags, ?string $origin = null): static
$flagsint
$origin = nullnull | stringonly replaces the current origin when not null
returnsstatic

StatusFlags($flags)

staticaEntry.php:147

Read the two-character <XY> field of a git status --porcelain=2 entry.

static function StatusFlags(string $flags): int
$flagsstring
returnsint

StatusModuleFlags($flags)

staticaEntry.php:181

Read the four-character <sub> field of a git status --porcelain=2 entry (N... for a plain file, S<c><m><u> for a submodule).

static function StatusModuleFlags(string $flags): int
$flagsstring
returnsint

StatusText($status, $sep)

staticaEntry.php:133

Convert git status constants to text.

static function StatusText(int $status, ?string $sep = ', '): array|string
$statusinta binary combination of the iEntry constants
$sep = ', 'null | stringif null, returns the list of texts, else implodes it with this separator
returnsarray | string
aEntry::StatusText(iEntry::WORKTREE_MODIFIED); // 'modified'

__construct($filename, $status, $origin)

aEntry.php:50
function __construct(string $filename, int $status = 0, ?string $origin = null)
$filenamestring
$status = 0int
$origin = nullnull | string
Inherited members (24)
ConstantsDeclared byDescription
CAN_BE_ADDEDiEntry
CAN_BE_COMMITEDiEntry
COMMIT_CHANGEDiEntry
ENTRY_STATUSiEntry
INDEX_ADDEDiEntry
INDEX_COPIEDiEntry
INDEX_DELETEDiEntry
INDEX_IGNOREDiEntry
INDEX_MODIFIEDiEntry
INDEX_RENAMEDiEntry
INDEX_UNMERGEDiEntry
INDEX_UNTRACKEDiEntry
MODULE_STATUSiEntry
TRACKED_CHANGESiEntry
UNKNOWN_ERRORiEntry
UNTRACKED_CHANGESiEntry
WORKTREE_ADDEDiEntry
WORKTREE_COPIEDiEntry
WORKTREE_DELETEDiEntry
WORKTREE_IGNOREDiEntry
WORKTREE_MODIFIEDiEntry
WORKTREE_RENAMEDiEntry
WORKTREE_UNMERGEDiEntry
WORKTREE_UNTRACKEDiEntry