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 * This file is part of fast-forward/dev-tools.
7 *
8 * This source file is subject to the license bundled
9 * with this source code in the file LICENSE.
10 *
11 * @copyright Copyright (c) 2026 Felipe SayĆ£o Lobato Abreu <github@mentordosnerds.com>
12 * @license   https://opensource.org/licenses/MIT MIT License
13 *
14 * @see       https://github.com/php-fast-forward/dev-tools
15 * @see       https://github.com/php-fast-forward
16 * @see       https://datatracker.ietf.org/doc/html/rfc2119
17 */
18
19namespace FastForward\DevTools\GitIgnore;
20
21/**
22 * Defines the contract for writing .gitignore representations to persistent storage.
23 *
24 * Implementations MUST persist the entries exposed by a GitIgnoreInterface
25 * instance to its associated path. Implementations SHALL preserve the semantic
26 * ordering of entries provided by the input object and SHOULD write content in a
27 * format compatible with standard .gitignore files.
28 */
29interface WriterInterface
30{
31    /**
32     * Writes the GitIgnore content to its associated filesystem path.
33     *
34     * The provided GitIgnoreInterface instance MUST contain the target path and
35     * the entries to be written. Implementations SHALL persist that content to
36     * the associated location represented by the given object.
37     *
38     * @param GitIgnoreInterface $gitignore The .gitignore representation to
39     *                                      write to persistent storage.
40     *
41     * @return void
42     */
43    public function write(GitIgnoreInterface $gitignore): void;
44}