Funding

Class
implements FundingInterface
Read only: Yes Final: Yes

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.

Table of Contents

Interfaces

FundingInterface

Defines the contract for representing a single entry of the "funding" section of a composer.json file.

Properties

 : string
 : string

Methods

__construct()

Constructs a new funding entry.

 : mixed
getType()

Retrieves the funding type.

 : string
getUrl()

Retrieves the funding URL.

 : string
Properties

$type

Private
private string $type

$url

Private
private string $url
Methods

__construct()

Public

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

getType()

Public

Retrieves the funding type.

public getType() : string

Description

This method MUST return the funding platform or mechanism identifier associated with this entry.

Return values
string

Description

the funding type identifier

getUrl()

Public

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
string

Description

the funding URL