Skip to content

GitAttributesCommand

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

Provides functionality to manage .gitattributes export-ignore rules.

This command adds export-ignore entries for repository-only files and directories to keep them out of Composer package archives.


Methods

__construct

Creates a new GitAttributesCommand instance.

public __construct(\FastForward\DevTools\GitAttributes\CandidateProviderInterface $candidateProvider, \FastForward\DevTools\GitAttributes\ExistenceCheckerInterface $existenceChecker, \FastForward\DevTools\GitAttributes\ExportIgnoreFilterInterface $exportIgnoreFilter, \FastForward\DevTools\GitAttributes\MergerInterface $merger, \FastForward\DevTools\GitAttributes\ReaderInterface $reader, \FastForward\DevTools\GitAttributes\WriterInterface $writer, \FastForward\DevTools\Composer\Json\ComposerJsonInterface $composer, \FastForward\DevTools\Filesystem\FilesystemInterface $filesystem, \FastForward\DevTools\Resource\FileDiffer $fileDiffer, \Psr\Log\LoggerInterface $logger): mixed

Parameters:

Parameter Type Description
$candidateProvider \FastForward\DevTools\GitAttributes\CandidateProviderInterface the candidate provider
$existenceChecker \FastForward\DevTools\GitAttributes\ExistenceCheckerInterface the repository path existence checker
$exportIgnoreFilter \FastForward\DevTools\GitAttributes\ExportIgnoreFilterInterface the configured candidate filter
$merger \FastForward\DevTools\GitAttributes\MergerInterface the merger component
$reader \FastForward\DevTools\GitAttributes\ReaderInterface the reader component
$writer \FastForward\DevTools\GitAttributes\WriterInterface the writer component
$composer \FastForward\DevTools\Composer\Json\ComposerJsonInterface the composer.json accessor
$filesystem \FastForward\DevTools\Filesystem\FilesystemInterface the filesystem component
$fileDiffer \FastForward\DevTools\Resource\FileDiffer
$logger \Psr\Log\LoggerInterface the output-aware logger

configure

Configures verification and interactive update modes.

protected configure(): void

execute

Configures the current command.

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

This method MUST define the name, description, and help text for the command.

Parameters:

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

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