class Printer

Generates PHP code.

Traits

Strict class for better experience.

Properties

protected string $indentation
protected int $linesBetweenMethods

Methods

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

No description

string
printClosure(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
printParameters($function, PhpNamespace|null $namespace)

No description

string
printReturnType($function, PhpNamespace|null $namespace)

No description

Details

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

Parameters

GlobalFunction $function
PhpNamespace $namespace

Return Value

string

at line 45
string printClosure(Closure $closure)

Parameters

Closure $closure

Return Value

string

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

Parameters

Method $method
PhpNamespace $namespace

Return Value

string

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

Parameters

ClassType $class
PhpNamespace $namespace

Return Value

string

at line 139
string printNamespace(PhpNamespace $namespace)

Parameters

PhpNamespace $namespace

Return Value

string

at line 174
string printFile(PhpFile $file)

Parameters

PhpFile $file

Return Value

string

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

Parameters

bool $state

Return Value

Printer

at line 201
protected string indent(string $s)

Parameters

string $s

Return Value

string

at line 210
protected string printParameters($function, PhpNamespace|null $namespace)

Parameters

$function
PhpNamespace|null $namespace

Return Value

string

at line 233
protected string printReturnType($function, PhpNamespace|null $namespace)

Parameters

$function
PhpNamespace|null $namespace

Return Value

string