ClassifierInterface

Interface

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.

Table of Contents

Methods

classify()

Classifies a .gitignore entry as directory or file pattern.

 : "directory"|"file"
isDirectory()

Determines whether the entry represents a directory pattern.

 : bool
isFile()

Determines whether the entry represents a file pattern.

 : bool
Methods

classify()

Public

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
"directory"|"file"

Description

the classification result

isDirectory()

Public

Determines whether the entry represents a directory pattern.

public isDirectory( string  $entry) : bool
Parameters
$entry : string

Description

the .gitignore entry to check

Return values
bool

Description

true if the entry is a directory pattern

isFile()

Public

Determines whether the entry represents a file pattern.

public isFile( string  $entry) : bool
Parameters
$entry : string

Description

the .gitignore entry to check

Return values
bool

Description

true if the entry is a file pattern