Skip to content

DocsCommand

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

Generates the package API documentation through phpDocumentor.

The command prepares a temporary phpDocumentor configuration from the current package metadata, then delegates execution to the shared process queue so logging and grouped output stay consistent with the rest of the command surface.


Methods

__construct

Creates a new DocsCommand instance.

public __construct(\FastForward\DevTools\Process\ProcessBuilderInterface $processBuilder, \FastForward\DevTools\Process\ProcessQueueInterface $processQueue, \Twig\Environment $renderer, \FastForward\DevTools\Filesystem\FilesystemInterface $filesystem, \FastForward\DevTools\Composer\Json\ComposerJsonInterface $composer, \Psr\Log\LoggerInterface $logger): mixed

Parameters:

Parameter Type Description
$processBuilder \FastForward\DevTools\Process\ProcessBuilderInterface the process builder for executing phpDocumentor
$processQueue \FastForward\DevTools\Process\ProcessQueueInterface the process queue for managing execution
$renderer \Twig\Environment
$filesystem \FastForward\DevTools\Filesystem\FilesystemInterface the filesystem for handling file operations
$composer \FastForward\DevTools\Composer\Json\ComposerJsonInterface the composer.json handler for accessing project metadata
$logger \Psr\Log\LoggerInterface the output-aware logger

configure

Configures the command options used to generate API documentation.

protected configure(): void

execute

Generates the HTML API documentation for the configured source tree.

protected execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output): int

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the input details for the command
$output \Symfony\Component\Console\Output\OutputInterface the output mechanism for logging

Return Value:

the final execution status code


Inherited methods

addJsonOption

Adds the standard JSON output options to the current command.

protected addJsonOption(): static

isJsonOutput

Determines whether JSON output was requested.

protected isJsonOutput(\Symfony\Component\Console\Input\InputInterface $input): bool

The pretty-json flag SHALL imply JSON output.

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface

isPrettyJsonOutput

Determines whether pretty JSON output was requested.

protected isPrettyJsonOutput(\Symfony\Component\Console\Input\InputInterface $input): bool

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface

addCacheOption

Adds the standard cache control option to the current command.

protected addCacheOption(string $description): static

Parameters:

Parameter Type Description
$description string the cache option description

addCacheDirOption

Adds the standard cache directory option to the current command.

protected addCacheDirOption(string $description, string $default): static

Parameters:

Parameter Type Description
$description string the cache directory option description
$default string the command-specific default cache directory

isCacheEnabled

Resolves whether cache writes SHOULD be enabled for the current invocation.

protected isCacheEnabled(\Symfony\Component\Console\Input\InputInterface $input, bool $default = true): bool

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the current command input
$default bool the command-specific default cache behavior when the option is omitted

resolveCacheArgument

Returns the explicit cache flag that SHOULD be forwarded to nested commands.

protected resolveCacheArgument(\Symfony\Component\Console\Input\InputInterface $input): ?string

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the current command input

resolveCacheDirArgument

Resolves a nested cache directory for a child command.

protected resolveCacheDirArgument(\Symfony\Component\Console\Input\InputInterface $input, string $path = ''): ?string

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the current command input
$path string the child cache path relative to the current command cache root

Clone this wiki locally