Represents a single funding entry from the optional "funding" section of a composer.json file.
Description
A funding entry identifies a funding platform or mechanism and the URL through which users MAY financially support package maintenance and future development.
This class is an immutable value object. All promoted properties are assigned at construction time and MUST NOT be modified afterward.
The type property SHOULD contain a meaningful funding platform identifier such as "patreon", "opencollective", "tidelift", "github", or "other".
The url property MUST contain the funding destination URL and SHOULD be a fully qualified URL.
Interfaces
Defines the contract for representing a single entry of the "funding" section of a composer.json file.
Properties
Methods
Constructs a new funding entry.
Retrieves the funding type.
Retrieves the funding URL.
Constructs a new funding entry.
public
__construct(
string
$type,
string
$url) : mixed
Description
The provided values SHALL be stored exactly as received.
Parameters
$type
:
string
Description
the funding platform or mechanism identifier
$url
:
string
Description
the URL that provides funding details and support options
Retrieves the funding type.
public
getType() : string
Description
This method MUST return the funding platform or mechanism identifier associated with this entry.
Return values
Description
the funding type identifier
Retrieves the funding URL.
public
getUrl() : string
Description
This method MUST return the URL that provides funding details and a way to financially support the package.
Return values
Description
the funding URL