Skip to content

ClassifierInterface

github-actions edited this page Apr 9, 2026 · 1 revision

Defines the contract for classifying .gitignore entries.

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.


  • Full name: \FastForward\DevTools\GitIgnore\ClassifierInterface

Methods

classify

Classifies a .gitignore entry as directory or file pattern.

public classify(string $entry): "directory"|"file"

Parameters:

Parameter Type Description
$entry string the .gitignore entry to classify

Return Value:

the classification result


isDirectory

Determines whether the entry represents a directory pattern.

public isDirectory(string $entry): bool

Parameters:

Parameter Type Description
$entry string the .gitignore entry to check

Return Value:

true if the entry is a directory pattern


isFile

Determines whether the entry represents a file pattern.

public isFile(string $entry): bool

Parameters:

Parameter Type Description
$entry string the .gitignore entry to check

Return Value:

true if the entry is a file pattern


Clone this wiki locally