class Printer

Generates PHP code.

Properties

protected string $indentation
protected int $linesBetweenProperties
protected int $linesBetweenMethods
protected string $returnTypeColon

Methods

string
printFunction(GlobalFunction $function, PhpNamespace $namespace = null)

No description

string
printClosure(Closure $closure)

No description

string
printArrowFunction(Closure $closure)

No description

string
printMethod(Method $method, PhpNamespace $namespace = null)

No description

string
printClass(ClassType $class, PhpNamespace $namespace = null)

No description

string
printNamespace(PhpNamespace $namespace)

No description

string
printFile(PhpFile $file)

No description

setTypeResolving(bool $state = true)

No description

string
indent(string $s)

No description

string
dump($var, int $column = 0)

No description

string
printUses(PhpNamespace $namespace)

No description

string
printParameters(Closure|GlobalFunction|Method $function, PhpNamespace $namespace = null, int $column = 0)

No description

string
printType(string|null $type, bool $nullable = false, PhpNamespace $namespace = null)

No description

Details

at line 39
string printFunction(GlobalFunction $function, PhpNamespace $namespace = null)

No description

Parameters

GlobalFunction $function
PhpNamespace $namespace

Return Value

string

at line 55
string printClosure(Closure $closure)

No description

Parameters

Closure $closure

Return Value

string

at line 75
string printArrowFunction(Closure $closure)

No description

Parameters

Closure $closure

Return Value

string

at line 92
string printMethod(Method $method, PhpNamespace $namespace = null)

No description

Parameters

Method $method
PhpNamespace $namespace

Return Value

string

at line 118
string printClass(ClassType $class, PhpNamespace $namespace = null)

No description

Parameters

ClassType $class
PhpNamespace $namespace

Return Value

string

at line 182
string printNamespace(PhpNamespace $namespace)

No description

Parameters

PhpNamespace $namespace

Return Value

string

at line 207
string printFile(PhpFile $file)

No description

Parameters

PhpFile $file

Return Value

string

at line 225
Printer setTypeResolving(bool $state = true)

No description

Parameters

bool $state

Return Value

Printer

at line 232
protected string indent(string $s)

No description

Parameters

string $s

Return Value

string

at line 239
protected string dump($var, int $column = 0)

No description

Parameters

$var
int $column

Return Value

string

at line 245
protected string printUses(PhpNamespace $namespace)

No description

Parameters

PhpNamespace $namespace

Return Value

string

at line 263
string printParameters(Closure|GlobalFunction|Method $function, PhpNamespace $namespace = null, int $column = 0)

No description

Parameters

Closure|GlobalFunction|Method $function
PhpNamespace $namespace
int $column

Return Value

string

at line 294
string printType(string|null $type, bool $nullable = false, PhpNamespace $namespace = null)

No description

Parameters

string|null $type
bool $nullable
PhpNamespace $namespace

Return Value

string

Traits

Strict class for better experience.