Psr2 Code Generator

Writer

A writer implementation.

This may be used to simplify writing well-formatted code.

Tags
author

Johannes M. Schmitt schmittjoh@gmail.com

author

Cristiano Cinotti cristianocinotti@gmail.com

Table of Contents

INDENTATION  = ' '
PSR-2 4 spaces indentation
$content  : string
$indentationLevel  : int
endsWith()  : bool
getContent()  : string
indent()  : self
outdent()  : self
reset()  : self
rtrim()  : self
write()  : Writer
writeln()  : Writer

Constants

INDENTATION

PSR-2 4 spaces indentation

public mixed INDENTATION = ' '

Properties

$content

private string $content = ''

$indentationLevel

private int $indentationLevel = 0

Methods

endsWith()

public endsWith(string $search) : bool
Parameters
$search : string
Return values
bool

getContent()

public getContent() : string
Return values
string

indent()

public indent() : self
Return values
self

outdent()

public outdent() : self
Return values
self

reset()

public reset() : self
Return values
self

rtrim()

public rtrim() : self
Return values
self

write()

public write(string $content) : Writer
Parameters
$content : string
Return values
Writer

writeln()

public writeln([string $content = '' ]) : Writer
Parameters
$content : string = ''
Return values
Writer

Search results