Skip to content

MergerInterface

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

Defines the contract for merging .gitignore entries.

This service SHALL combine canonical and project-specific .gitignore definitions into a single normalized result. The resulting entry list MUST exclude blank lines and comment lines from the merged output, MUST remove duplicate entries, and MUST group directory entries before file entries. Directory and file groups SHALL be sorted independently in ascending string order to provide deterministic output.


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

Methods

merge

Merges two GitIgnore instances, removing duplicates and sorting entries.

public merge(\FastForward\DevTools\GitIgnore\GitIgnoreInterface $canonical, \FastForward\DevTools\GitIgnore\GitIgnoreInterface $project): \FastForward\DevTools\GitIgnore\GitIgnoreInterface

Directories are placed before files in the resulting list. The path from $project is used in the returned instance.

Parameters:

Parameter Type Description
$canonical \FastForward\DevTools\GitIgnore\GitIgnoreInterface the canonical .gitignore from dev-tools
$project \FastForward\DevTools\GitIgnore\GitIgnoreInterface the project-specific .gitignore

Return Value:

a new GitIgnore instance with merged entries


Clone this wiki locally