-
-
Notifications
You must be signed in to change notification settings - Fork 0
CodeStyleCommand
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
| Constant | Visibility | Type | Value |
|---|---|---|---|
CONFIG |
public | string | 'ecs.php' |
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): mixedThe 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 |
Configures the current command.
protected configure(): voidThis 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.
Executes the code style checks and fixes block.
protected execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output): intThe 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