Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/**
6 * Fast Forward Development Tools for PHP projects.
7 *
8 * This file is part of fast-forward/dev-tools project.
9 *
10 * @author   Felipe SayĆ£o Lobato Abreu <github@mentordosnerds.com>
11 * @license  https://opensource.org/licenses/MIT MIT License
12 *
13 * @see      https://github.com/php-fast-forward/
14 * @see      https://github.com/php-fast-forward/dev-tools
15 * @see      https://github.com/php-fast-forward/dev-tools/issues
16 * @see      https://php-fast-forward.github.io/dev-tools/
17 * @see      https://datatracker.ietf.org/doc/html/rfc2119
18 */
19
20namespace FastForward\DevTools\GitAttributes;
21
22/**
23 * Merges export-ignore entries with existing .gitattributes content.
24 *
25 * This interface defines the contract for managing .gitattributes files,
26 * specifically handling the merging of canonical export-ignore rules with
27 * existing custom entries while removing obsolete generated markers and
28 * duplicate lines.
29 */
30interface MergerInterface
31{
32    /**
33     * Merges generated export-ignore entries with existing .gitattributes content.
34     *
35     * @param string $existingContent The current .gitattributes content.
36     * @param list<string> $exportIgnoreEntries The export-ignore entries to manage
37     * @param list<string> $keepInExportPaths The paths that MUST remain exported
38     *
39     * @return string The merged .gitattributes content
40     */
41    public function merge(string $existingContent, array $exportIgnoreEntries, array $keepInExportPaths = []): string;
42}