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 | * 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 | |
| 20 | namespace FastForward\DevTools\License; |
| 21 | |
| 22 | /** |
| 23 | * Generates LICENSE files from composer.json metadata. |
| 24 | * |
| 25 | * This interface defines the contract for generating license files |
| 26 | * by reading composer.json and producing appropriate license content. |
| 27 | */ |
| 28 | interface GeneratorInterface |
| 29 | { |
| 30 | /** |
| 31 | * Generates license content without writing it to disk. |
| 32 | * |
| 33 | * @return string|null the generated license content, or null when generation is not possible |
| 34 | */ |
| 35 | public function generateContent(): ?string; |
| 36 | |
| 37 | /** |
| 38 | * Generates a LICENSE file at the specified path. |
| 39 | * |
| 40 | * Reads the license from composer.json, validates it's supported, |
| 41 | * loads the appropriate template, resolves placeholders, and writes |
| 42 | * the LICENSE file to the target path. |
| 43 | * |
| 44 | * @param string $targetPath The full path where the LICENSE file should be written |
| 45 | * |
| 46 | * @return string|null The generated license content, or null if generation failed |
| 47 | */ |
| 48 | public function generate(string $targetPath): ?string; |
| 49 | } |