ReportsCommand

Class
extends BaseCommand
Final: Yes

Coordinates the generation of Fast Forward documentation frontpage and related reports.

Description

This class MUST NOT be overridden and SHALL securely combine docs and testing commands.

Attributes
#[AsCommand]
$name : 'reports'
$description : 'Generates the frontpage for Fast Forward documentation.'
$help : 'This command generates the frontpage for Fast Forward documentation, including links to API documentation and test reports.'

Table of Contents

Interfaces

LoggerAwareCommandInterface

Defines the logger contract consumed by reusable command result helpers.

Properties

Methods

__construct()

Initializes the command with required dependencies.

 : mixed
addJsonOption()

Adds the standard JSON output options to the current command.

 : static
 : void
execute()

Executes the generation logic for diverse reports.

 : int
isJsonOutput()

Determines whether JSON output was requested.

 : bool
isPrettyJsonOutput()

Determines whether pretty JSON output was requested.

 : bool
failure()

Logs a failed command result and returns the failure exit code.

 : int
notice()

Logs an informational command message at notice level.

 : void
success()

Logs a successful command result and returns the success exit code.

 : int
Properties
Methods

__construct()

Public

Initializes the command with required dependencies.

public __construct(ProcessBuilderInterface  $processBuilder, ProcessQueueInterface  $processQueue, LoggerInterface  $logger) : mixed
Parameters
$processBuilder : ProcessBuilderInterface

Description

the builder instance used to construct execution processes

$processQueue : ProcessQueueInterface

Description

the execution queue mechanism for running sub-processes

$logger : LoggerInterface

Description

the output-aware logger

addJsonOption()

Protected

Adds the standard JSON output options to the current command.

protected addJsonOption() : static
Return values
static

execute()

Protected

Executes the generation logic for diverse reports.

protected execute(InputInterface  $input, OutputInterface  $output) : int

Description

The method MUST run the underlying docs and tests commands. It SHALL process and generate the frontpage output file successfully.

Parameters
$input : InputInterface

Description

the structured inputs holding specific arguments

$output : OutputInterface

Description

the designated output interface

Return values
int

Description

the integer outcome from the base process execution

isJsonOutput()

Protected

Determines whether JSON output was requested.

protected isJsonOutput(InputInterface  $input) : bool

Description

The pretty-json flag SHALL imply JSON output.

Parameters
$input : InputInterface
Return values
bool

isPrettyJsonOutput()

Protected

Determines whether pretty JSON output was requested.

protected isPrettyJsonOutput(InputInterface  $input) : bool
Parameters
$input : InputInterface
Return values
bool

failure()

Private

Logs a failed command result and returns the failure exit code.

private failure( string  $message, InputInterface  $input[, array<string, mixed>  $context = []][, string|null  $file = null][, int|null  $line = null]) : int
Parameters
$message : string

Description

the failure message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

$file : string|null = null

Description

the related file path when known

$line : int|null = null

Description

the related line when known

Return values
int

notice()

Private

Logs an informational command message at notice level.

private notice( string  $message, InputInterface  $input[, array<string, mixed>  $context = []]) : void
Parameters
$message : string

Description

the notice message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

success()

Private

Logs a successful command result and returns the success exit code.

private success( string  $message, InputInterface  $input[, array<string, mixed>  $context = []][, string  $logLevel = LogLevel::INFO]) : int
Parameters
$message : string

Description

the success message

$input : InputInterface

Description

the originating command input

$context : array<string, mixed> = []

Description

optional extra log context

$logLevel : string = LogLevel::INFO

Description

the PSR-3 log level used for the successful result

Return values
int