Skip to content

LicenseCommand

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

Generates and copies LICENSE files to projects.

This command generates a LICENSE file if one does not exist and a supported license is declared in composer.json.


Methods

__construct

Creates a new LicenseCommand instance.

public __construct(\FastForward\DevTools\License\GeneratorInterface $generator, \FastForward\DevTools\Filesystem\FilesystemInterface $filesystem, \FastForward\DevTools\Resource\FileDiffer $fileDiffer, \Psr\Log\LoggerInterface $logger): mixed

Parameters:

Parameter Type Description
$generator \FastForward\DevTools\License\GeneratorInterface the generator component
$filesystem \FastForward\DevTools\Filesystem\FilesystemInterface the filesystem component
$fileDiffer \FastForward\DevTools\Resource\FileDiffer
$logger \Psr\Log\LoggerInterface the output-aware logger

configure

{@inheritDoc}

protected configure(): void

execute

Executes the license generation process.

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

Generates a LICENSE file if one does not exist and a supported license is declared in composer.json.

Parameters:

Parameter Type Description
$input \Symfony\Component\Console\Input\InputInterface the input interface
$output \Symfony\Component\Console\Output\OutputInterface the output interface

Return Value:

the 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

Clone this wiki locally