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
22/**
23 * Defines the contract for representing a single entry of the "funding" section
24 * of a composer.json file.
25 *
26 * A funding entry describes a funding channel through which package users MAY
27 * support the package authors in the maintenance of the project and the
28 * development of new functionality. Each funding entry consists of a funding
29 * type and a URL.
30 *
31 * Implementations of this interface MUST provide access to both the funding
32 * platform type and the funding URL. The type SHOULD describe the platform or
33 * mechanism through which funding can be provided, such as "patreon",
34 * "opencollective", "tidelift", "github", or another recognized identifier.
35 *
36 * The URL MUST point to a resource where funding details are available and
37 * through which financial support MAY be provided. Implementations SHOULD
38 * return a fully qualified URL.
39 *
40 * Since the "funding" section is optional in composer.json, implementations MAY
41 * be used in collections containing zero or more funding entries.
42 *
43 * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
44 * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
45 * interface are to be interpreted as described in RFC 2119.
46 */
47interface FundingInterface
48{
49    /**
50     * Retrieves the funding type.
51     *
52     * This method MUST return the funding platform or funding mechanism
53     * identifier associated with this entry.
54     *
55     * Implementations SHOULD return a normalized and meaningful value, such as
56     * "patreon", "opencollective", "tidelift", "github", or "other".
57     *
58     * @return string the funding type identifier
59     */
60    public function getType(): string;
61
62    /**
63     * Retrieves the funding URL.
64     *
65     * This method MUST return the URL that provides funding details and a way
66     * to financially support the package.
67     *
68     * Implementations SHOULD return a fully qualified URL and MUST preserve the
69     * semantic meaning of the configured funding destination.
70     *
71     * @return string the funding URL
72     */
73    public function getUrl(): string;
74}