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 | |
| 3 | declare(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 | |
| 19 | namespace FastForward\DevTools\GitIgnore; |
| 20 | |
| 21 | use IteratorAggregate; |
| 22 | |
| 23 | /** |
| 24 | * Defines the contract for a .gitignore file with its path and entries. |
| 25 | * |
| 26 | * This interface MUST be implemented by any class that represents a .gitignore file. |
| 27 | * It SHALL allow iteration over entries and provide access to the file path. |
| 28 | * |
| 29 | * @extends IteratorAggregate<int, string> |
| 30 | */ |
| 31 | interface GitIgnoreInterface extends IteratorAggregate |
| 32 | { |
| 33 | /** |
| 34 | * Returns the file system path to the .gitignore file. |
| 35 | * |
| 36 | * @return string the absolute path to the .gitignore file |
| 37 | */ |
| 38 | public function path(): string; |
| 39 | |
| 40 | /** |
| 41 | * Returns the list of entries from the .gitignore file. |
| 42 | * |
| 43 | * @return list<string> the non-empty .gitignore entries |
| 44 | */ |
| 45 | public function entries(): array; |
| 46 | } |