Renders and persists normalized .gitignore content.
Description
This writer SHALL transform a GitIgnoreInterface representation into the textual format expected by a .gitignore file and MUST persist that content to the target path exposed by the provided object. Implementations MUST write a trailing line feed to ensure consistent file formatting.
Interfaces
Properties
Methods
Creates a writer with the filesystem dependency used for persistence.
Writes the normalized .gitignore entries to the target file path.
Creates a writer with the filesystem dependency used for persistence.
public
__construct(Filesystem
$filesystem) : mixed
Description
The provided filesystem implementation MUST support writing file contents to the target path returned by a GitIgnoreInterface instance.
Parameters
$filesystem
:
Filesystem
Description
The filesystem service responsible for writing the rendered .gitignore content.
Writes the normalized .gitignore entries to the target file path.
public
write(GitIgnoreInterface
$gitignore) : void
Description
The implementation SHALL join all entries using a Unix line feed and MUST append a final trailing line feed to the generated content. The resulting content MUST be written to the path returned by $gitignore->path().
Parameters
Description
The .gitignore representation whose path and entries SHALL be written.