ClassifierInterface
Defines the contract for classifying .gitignore entries.
Description
This classifier SHALL inspect a raw .gitignore entry and determine whether the entry expresses directory semantics or file semantics. Implementations MUST preserve deterministic classification for identical inputs. Blank entries and comment entries MUST be treated as file-oriented values to avoid incorrectly inferring directory intent where no effective pattern exists.
Methods
Classifies a .gitignore entry as directory or file pattern.
Determines whether the entry represents a directory pattern.
Determines whether the entry represents a file pattern.
Classifies a .gitignore entry as directory or file pattern.
public
classify(
string
$entry) : "directory"|"file"
Parameters
$entry
:
string
Description
the .gitignore entry to classify
Return values
Description
the classification result
Determines whether the entry represents a directory pattern.
public
isDirectory(
string
$entry) : bool
Parameters
$entry
:
string
Description
the .gitignore entry to check
Return values
Description
true if the entry is a directory pattern
Determines whether the entry represents a file pattern.
public
isFile(
string
$entry) : bool
Parameters
$entry
:
string
Description
the .gitignore entry to check
Return values
Description
true if the entry is a file pattern