WriterInterface

Interface

Defines the contract for writing .gitignore representations to persistent storage.

Description

Implementations MUST persist the entries exposed by a GitIgnoreInterface instance to its associated path. Implementations SHALL preserve the semantic ordering of entries provided by the input object and SHOULD write content in a format compatible with standard .gitignore files.

Table of Contents

Methods

render()

Renders the GitIgnore content without persisting it.

 : string
write()

Writes the GitIgnore content to its associated filesystem path.

 : void
Methods

render()

Public

Renders the GitIgnore content without persisting it.

public render(GitIgnoreInterface  $gitignore) : string
Parameters
$gitignore : GitIgnoreInterface

Description

the .gitignore representation to render

Return values
string

Description

the normalized .gitignore file content

write()

Public

Writes the GitIgnore content to its associated filesystem path.

public write(GitIgnoreInterface  $gitignore) : void

Description

The provided GitIgnoreInterface instance MUST contain the target path and the entries to be written. Implementations SHALL persist that content to the associated location represented by the given object.

Parameters
$gitignore : GitIgnoreInterface

Description

The .gitignore representation to write to persistent storage.