-
-
Notifications
You must be signed in to change notification settings - Fork 0
Writer
Renders and persists normalized .gitignore content.
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.
- Full name:
\FastForward\DevTools\GitIgnore\Writer - This class is marked as final and can't be subclassed
- This class implements:
\FastForward\DevTools\GitIgnore\WriterInterface - This class is a Final class
Creates a writer with the filesystem dependency used for persistence.
public __construct(\Symfony\Component\Filesystem\Filesystem $filesystem): mixedThe provided filesystem implementation MUST support writing file contents to the target path returned by a GitIgnoreInterface instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filesystem |
\Symfony\Component\Filesystem\Filesystem | The filesystem service responsible for |
| writing the rendered .gitignore content. |
Writes the normalized .gitignore entries to the target file path.
public write(\FastForward\DevTools\GitIgnore\GitIgnoreInterface $gitignore): voidThe 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:
| Parameter | Type | Description |
|---|---|---|
$gitignore |
\FastForward\DevTools\GitIgnore\GitIgnoreInterface | The .gitignore representation whose |
| path and entries SHALL be written. |