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\License;
20
21/**
22 * Reads and exposes metadata from composer.json for license generation.
23 *
24 * This interface provides access to license information, package name,
25 * authors, vendor, and year data extracted from a project's composer.json.
26 */
27interface ReaderInterface
28{
29    /**
30     * Retrieves the license identifier from composer.json.
31     *
32     * @return string|null the license string, or null if not set or unsupported
33     */
34    public function getLicense(): ?string;
35
36    /**
37     * Retrieves the package name from composer.json.
38     *
39     * @return string the full package name (vendor/package)
40     */
41    public function getPackageName(): string;
42
43    /**
44     * Retrieves the list of authors from composer.json.
45     *
46     * @return array<int, array{name: string, email: string, homepage: string, role: string}>
47     */
48    public function getAuthors(): array;
49
50    /**
51     * Extracts the vendor name from the package name.
52     *
53     * @return string|null the vendor name, or null if package has no vendor prefix
54     */
55    public function getVendor(): ?string;
56
57    /**
58     * Returns the current year for copyright notices.
59     *
60     * @return int the current year as an integer
61     */
62    public function getYear(): int;
63}