Index

File

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

class

File

File.php:9

One file inside a Repository, as git status reported it.

class MMO\git\helpers\File extends MMO\git\classes\aEntry
Namespace
MMO\git\helpers
Extends
aEntry

Methods6

addToCommit($option)

File.php:27

Stage the file. @return string

function addToCommit(string $option = ''): string
$option = ''string
returnsstring

getRepository()

File.php:22
function getRepository(): MMO\git\helpers\Repository
returnsRepositorythe repository the file belongs to.

mtime($options)

File.php:42
function mtime(string $options = ''): ?int
$options = ''string
returnsnull | intthe timestamp of the last commit that touched the file.

remove($option)

File.php:32

Unstage and delete the file. @return string

function remove(string $option = ''): string
$option = ''string
returnsstring

show($revision)

File.php:37
function show(string $revision = 'HEAD'): string
$revision = 'HEAD'string
returnsstringthe file's content at $revision.

__construct($repo, $filename, $status, $origin)

File.php:16
function __construct( MMO\git\helpers\Repository $repo, string $filename, int $status = 0, ?string $origin = null )
$repoRepositorythe repository the file belongs to
$filenamestringthe absolute filename
$status = 0intthe status, as a combination of the iEntry flags
$origin = nullnull | stringthe previous path, when git reported a rename or a copy
Inherited members (44)
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
PropertiesDeclared byDescription
filenameaEntry
originaEntry
parentaEntry
statusaEntry
STATUS_TEXTaEntry
MethodsDeclared byDescription
addStatus($flags)aEntry
clearStatus($flags)aEntry
debugName()aEntry
getFilename()aEntry
getOrigin()aEntry
getParent()aEntry
getStatus()aEntry
getStatusText($sep)aEntry
relativeFilename()aEntryThe filename relative to the repository this entry belongs to.
setOrigin($origin)aEntry
setParent($parent)aEntry
setStatus($flags, $origin)aEntryReplace the status flags, and -- because git reports a rename's previous path alongside its status -- optionally the origin in the same call.
StatusFlags($flags)aEntryRead the two-character <XY> field of a git status --porcelain=2 entry.
StatusModuleFlags($flags)aEntryRead 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)aEntryConvert git status constants to text.