Skip to content

Funding

github-actions edited this page Apr 17, 2026 · 1 revision

Represents a single funding entry from the optional "funding" section of a composer.json file.

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.


Methods

__construct

Constructs a new funding entry.

public __construct(string $type, string $url): mixed

The provided values SHALL be stored exactly as received.

Parameters:

Parameter Type Description
$type string the funding platform or mechanism identifier
$url string the URL that provides funding details and support options

getType

Retrieves the funding type.

public getType(): string

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

Return Value:

the funding type identifier


getUrl

Retrieves the funding URL.

public getUrl(): string

This method MUST return the URL that provides funding details and a way to financially support the package.

Return Value:

the funding URL


Clone this wiki locally