Skip to content
PHP Ecosystem
Explore

ListMergeStrategy

API reference › Scaffold › Merge › ListMergeStrategy

final classPHPForge\Scaffold\Merge\ListMergeStrategy
ExtendsAbstractLineMergeStrategy
ImplementsMergeStrategy
Sourcesrc/Merge/ListMergeStrategy.php

Merges ignore-style list files (.gitignore, .gitattributes and similar) by entry, never by comment.

MethodDescriptionDefined by
merge()Adds the provider entries missing from the consumer.AbstractLineMergeStrategy
plan() protectedPlans missing entries under the consumer’s matching comment header, or as new commented blocks at the end.ListMergeStrategy
protected function plan(list<string> $provider, list<string> $consumer): PHPForge\Scaffold\Merge\MergePlan

Plans missing entries under the consumer’s matching comment header, or as new commented blocks at the end.

Parameters

ParameterTypeDescription
$providerlist<string>Provider lines.
$consumerlist<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.