ProjectCapabilitiesResolver
Resolves which repository surfaces are available to documentation, testing, and wiki tooling.
Interfaces
Resolves the effective documentation, testing, and wiki capabilities of the current repository.
Constants
Properties
Methods
Creates a capability resolver backed by Composer autoload metadata and filesystem checks.
Resolves which documentation, testing, and wiki surfaces are available for the current repository.
Flattens Composer autoload path definitions into a normalized list of non-empty paths.
Resolves project-relative API directories exposed by Composer autoload configuration.
Resolves the default API package name from the first PSR-4 namespace entry when available.
Resolves whether Composer autoload metadata exposes testable PHP source for the repository.
Resolves a Composer autoload path into a project-relative API directory when it exists.
private
ComposerJsonInterface
$composer
private
FilesystemInterface
$filesystem
Creates a capability resolver backed by Composer autoload metadata and filesystem checks.
public
__construct(ComposerJsonInterface
$composer, FilesystemInterface
$filesystem) : mixed
Parameters
Description
the composer.json accessor for autoload metadata
Description
the filesystem used to resolve project-relative paths
Resolves which documentation, testing, and wiki surfaces are available for the current repository.
public
resolve([
string
$testsPath = ProjectCapabilitiesResolverInterface::DEFAULT_TESTS_PATH][,
string
$guideDirectory = ProjectCapabilitiesResolverInterface::DEFAULT_GUIDE_DIRECTORY][,
string
$wikiTarget = ProjectCapabilitiesResolverInterface::DEFAULT_WIKI_TARGET]) : ProjectCapabilities
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
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
Resolves project-relative API directories exposed by Composer autoload configuration.
private
resolveApiDirectories() : array<int, string>
Return values
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
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
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