ReaderInterface

Interface

Reads and exposes metadata from composer.json for license generation.

Description

This interface provides access to license information, package name, authors, vendor, and year data extracted from a project's composer.json.

Table of Contents

Methods

getAuthors()

Retrieves the list of authors from composer.json.

 : array<int, array{name: string, email: string, homepage: string, role: string}>
getLicense()

Retrieves the license identifier from composer.json.

 : string|null
getPackageName()

Retrieves the package name from composer.json.

 : string
getVendor()

Extracts the vendor name from the package name.

 : string|null
getYear()

Returns the current year for copyright notices.

 : int
Methods

getAuthors()

Public

Retrieves the list of authors from composer.json.

public getAuthors() : array<int, array{name: string, email: string, homepage: string, role: string}>
Return values
array<int, array{name: string, email: string, homepage: string, role: string}>

getLicense()

Public

Retrieves the license identifier from composer.json.

public getLicense() : string|null
Return values
string|null

Description

the license string, or null if not set or unsupported

getPackageName()

Public

Retrieves the package name from composer.json.

public getPackageName() : string
Return values
string

Description

the full package name (vendor/package)

getVendor()

Public

Extracts the vendor name from the package name.

public getVendor() : string|null
Return values
string|null

Description

the vendor name, or null if package has no vendor prefix

getYear()

Public

Returns the current year for copyright notices.

public getYear() : int
Return values
int

Description

the current year as an integer