ProjectCapabilitiesResolver

Class
Read only: Yes Final: Yes

Resolves which repository surfaces are available to documentation, testing, and wiki tooling.

Table of Contents

Interfaces

ProjectCapabilitiesResolverInterface

Resolves the effective documentation, testing, and wiki capabilities of the current repository.

Constants

 = ['psr-4', 'psr-0', 'classmap']

Properties

Methods

__construct()

Creates a capability resolver backed by Composer autoload metadata and filesystem checks.

 : mixed
resolve()

Resolves which documentation, testing, and wiki surfaces are available for the current repository.

 : ProjectCapabilities
normalizeAutoloadPaths()

Flattens Composer autoload path definitions into a normalized list of non-empty paths.

 : array<int, string>
resolveApiDirectories()

Resolves project-relative API directories exposed by Composer autoload configuration.

 : array<int, string>
resolveDefaultPackageName()

Resolves the default API package name from the first PSR-4 namespace entry when available.

 : string|null
resolveHasPhpSourceFiles()

Resolves whether Composer autoload metadata exposes testable PHP source for the repository.

 : bool
resolveRelativeApiDirectory()

Resolves a Composer autoload path into a project-relative API directory when it exists.

 : string|null
Constants

Constants

API_AUTOLOAD_TYPES

Private
private array<int, string> API_AUTOLOAD_TYPES = ['psr-4', 'psr-0', 'classmap']

Description

Composer autoload sections that MAY expose API source directories

Properties
Methods

resolve()

Public

Resolves which documentation, testing, and wiki surfaces are available for the current repository.

Parameters

Description

the project-relative tests directory to inspect

Description

the project-relative guide directory to inspect

Description

the project-relative wiki output target to inspect

Return values

normalizeAutoloadPaths()

Private

Flattens Composer autoload path definitions into a normalized list of non-empty paths.

private normalizeAutoloadPaths( array<string, mixed>  $autoload) : array<int, string>
Parameters
$autoload : array<string, mixed>

Description

the Composer autoload section to normalize

Return values
array<int, string>

resolveApiDirectories()

Private

Resolves project-relative API directories exposed by Composer autoload configuration.

private resolveApiDirectories() : array<int, string>
Return values
array<int, string>

resolveDefaultPackageName()

Private

Resolves the default API package name from the first PSR-4 namespace entry when available.

private resolveDefaultPackageName( array<string, mixed>  $psr4Autoload) : string|null
Parameters
$psr4Autoload : array<string, mixed>

Description

the PSR-4 autoload map from composer.json

Return values
string|null

resolveHasPhpSourceFiles()

Private

Resolves whether Composer autoload metadata exposes testable PHP source for the repository.

private resolveHasPhpSourceFiles( array<int, string>  $apiDirectories) : bool
Parameters
$apiDirectories : array<int, string>

Description

the resolved API directories exposed by Composer autoload metadata

Return values
bool

resolveRelativeApiDirectory()

Private

Resolves a Composer autoload path into a project-relative API directory when it exists.

private resolveRelativeApiDirectory( string  $path) : string|null
Parameters
$path : string

Description

the Composer autoload path candidate

Return values
string|null