Skip to content

CodeStyleCommand

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

Represents the command responsible for checking and fixing code style issues.

This class MUST NOT be overridden and SHALL rely on external tools like ECS and Composer Normalize.


  • Full name: \FastForward\DevTools\Console\Command\CodeStyleCommand
  • Parent class: BaseCommand
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Constants

Constant Visibility Type Value
CONFIG public string 'ecs.php'

Methods

__construct

Constructs a new command instance responsible for orchestrating code style checks.

public __construct(\Symfony\Component\Config\FileLocatorInterface $fileLocator, \FastForward\DevTools\Process\ProcessBuilderInterface $processBuilder, \FastForward\DevTools\Process\ProcessQueueInterface $processQueue): mixed

The provided collaborators SHALL be used to locate the ECS configuration, build process definitions, and execute the resulting process queue. These dependencies MUST be valid service instances capable of supporting the command lifecycle expected by this class.

Parameters:

Parameter Type Description
$fileLocator \Symfony\Component\Config\FileLocatorInterface locates the configuration file required by EasyCodingStandard
$processBuilder \FastForward\DevTools\Process\ProcessBuilderInterface builds the process instances used to execute Composer and ECS commands
$processQueue \FastForward\DevTools\Process\ProcessQueueInterface queues and executes the generated processes in the required order

configure

Configures the current command.

protected configure(): void

This method MUST define the name, description, help text, and options for the command. It SHALL register the --fix option to allow automatic resolutions of style issues.


execute

Executes the code style checks and fixes block.

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

The method MUST execute composer update --lock, composer normalize, and ECS using secure processes. It SHALL return self::SUCCESS if all commands succeed, or self::FAILURE otherwise.

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the input interface to retrieve options
$output \Symfony\Component\Console\Output\OutputInterface the output interface to log messages

Return Value:

the status code of the command


Clone this wiki locally