ListMergeStrategy
API reference › Scaffold › Merge › ListMergeStrategy
Merges ignore-style list files (.gitignore, .gitattributes and similar) by entry, never by comment.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
merge() | Adds the provider entries missing from the consumer. | AbstractLineMergeStrategy |
plan() protected | Plans missing entries under the consumer’s matching comment header, or as new commented blocks at the end. | ListMergeStrategy |
Method details
Section titled “Method details”plan()
Section titled “plan() ”protected function plan(list<string> $provider, list<string> $consumer): PHPForge\Scaffold\Merge\MergePlanPlans missing entries under the consumer’s matching comment header, or as new commented blocks at the end.
Parameters
| Parameter | Type | Description |
|---|---|---|
$provider | list<string> | Provider lines. |
$consumer | list<string> | Consumer lines without terminators. |
Returns
PHPForge\Scaffold\Merge\MergePlan: Lines to insert after a consumer line index and blocks to append; both empty when satisfied.