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\Composer\Json\Schema;
21
22use Stringable;
23
24/**
25 * Defines the contract for representing an author entry within a composer.json file.
26 *
27 * Implementations of this interface MUST provide consistent and valid author metadata,
28 * including name, email, homepage, and role. These values SHALL be used for serialization
29 * and interoperability with Composer specifications.
30 *
31 * Implementing classes MUST also implement the Stringable interface, meaning they SHALL
32 * provide a __toString() method that returns a string representation of the author.
33 *
34 * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
35 * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
36 * interface are to be interpreted as described in RFC 2119.  [oai_citation:0‡rfc2119.txt](file-service://file-6PyYAHaGB569Cn3X4DVdVh)
37 */
38interface AuthorInterface extends Stringable
39{
40    /**
41     * Retrieves the name of the author.
42     *
43     * This method MUST return a non-empty string representing the author's name.
44     * Implementations SHOULD ensure that the name is human-readable and properly formatted.
45     *
46     * @return string the full name of the author
47     */
48    public function getName(): string;
49
50    /**
51     * Retrieves the email address of the author.
52     *
53     * This method MUST return a valid email address string.
54     * Implementations SHOULD validate the format according to RFC standards where applicable.
55     *
56     * @return string the email address of the author
57     */
58    public function getEmail(): string;
59
60    /**
61     * Retrieves the homepage URL of the author.
62     *
63     * This method MUST return a valid URL string.
64     * Implementations MAY return an empty string if no homepage is defined,
65     * but SHOULD prefer a fully qualified URL when available.
66     *
67     * @return string the homepage URL of the author
68     */
69    public function getHomepage(): string;
70
71    /**
72     * Retrieves the role of the author.
73     *
74     * This method MUST describe the role of the author in the project (e.g., "Developer", "Maintainer").
75     * Implementations SHOULD use consistent and meaningful role definitions.
76     *
77     * @return string the role of the author
78     */
79    public function getRole(): string;
80}