class ManageGitIgnore (View source)

internal  
 

Manage the .gitignore file.

Properties

protected IOInterface $io

Composer's I/O service.

protected string $dir

The directory where the project is located.

Methods

__construct(IOInterface $io, string $dir)

ManageGitIgnore constructor.

manageIgnored(array $files, ScaffoldOptions $options)

Manages gitignore files.

bool
managementOfGitIgnoreEnabled(ScaffoldOptions $options)

Determines whether we should manage gitignore files.

addToGitIgnore(string $dir, array $entries)

Adds a set of entries to the specified .gitignore file.

Details

__construct(IOInterface $io, string $dir)

ManageGitIgnore constructor.

Parameters

IOInterface $io
string $dir

The directory where the project is located.

manageIgnored(array $files, ScaffoldOptions $options)

Manages gitignore files.

Parameters

array $files

A list of scaffold results, each of which holds a path and whether or not that file is managed.

ScaffoldOptions $options

Configuration options from the composer.json extras section.

protected bool managementOfGitIgnoreEnabled(ScaffoldOptions $options)

Determines whether we should manage gitignore files.

Parameters

ScaffoldOptions $options

Configuration options from the composer.json extras section.

Return Value

bool

Whether or not gitignore files should be managed.

protected addToGitIgnore(string $dir, array $entries)

Adds a set of entries to the specified .gitignore file.

Parameters

string $dir

Path to directory where gitignore should be written.

array $entries

Entries to write to .gitignore file.