AuthorInterface

Interface
extends Stringable

Defines the contract for representing an author entry within a composer.json file.

Description

Implementations of this interface MUST provide consistent and valid author metadata, including name, email, homepage, and role. These values SHALL be used for serialization and interoperability with Composer specifications.

Implementing classes MUST also implement the Stringable interface, meaning they SHALL provide a __toString() method that returns a string representation of the author.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this interface are to be interpreted as described in RFC 2119. oai_citation:0‡rfc2119.txt

Table of Contents

Methods

getEmail()

Retrieves the email address of the author.

 : string
getHomepage()

Retrieves the homepage URL of the author.

 : string
getName()

Retrieves the name of the author.

 : string
getRole()

Retrieves the role of the author.

 : string
Methods

getEmail()

Public

Retrieves the email address of the author.

public getEmail() : string

Description

This method MUST return a valid email address string. Implementations SHOULD validate the format according to RFC standards where applicable.

Return values
string

Description

the email address of the author

getHomepage()

Public

Retrieves the homepage URL of the author.

public getHomepage() : string

Description

This method MUST return a valid URL string. Implementations MAY return an empty string if no homepage is defined, but SHOULD prefer a fully qualified URL when available.

Return values
string

Description

the homepage URL of the author

getName()

Public

Retrieves the name of the author.

public getName() : string

Description

This method MUST return a non-empty string representing the author's name. Implementations SHOULD ensure that the name is human-readable and properly formatted.

Return values
string

Description

the full name of the author

getRole()

Public

Retrieves the role of the author.

public getRole() : string

Description

This method MUST describe the role of the author in the project (e.g., "Developer", "Maintainer"). Implementations SHOULD use consistent and meaningful role definitions.

Return values
string

Description

the role of the author