class Printer

Generates PHP code.

Properties

int $wrapLength
protected string $indentation
protected int $linesBetweenProperties
protected int $linesBetweenMethods
protected string $returnTypeColon
protected PhpNamespace $namespace
protected Dumper $dumper

Methods

__construct()

No description

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

No description

string
printClosure(Closure $closure, PhpNamespace $namespace = null)

No description

string
printArrowFunction(Closure $closure, PhpNamespace $namespace = null)

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

string
printUses(PhpNamespace $namespace, string $of = PhpNamespace::NAME_NORMAL)

No description

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

No description

string
printType(string|null $type, bool $nullable)

No description

setTypeResolving(bool $state = true)

No description

string
indent(string $s)

No description

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

No description

Details

at line 48
__construct()

No description

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

No description

Parameters

GlobalFunction $function
PhpNamespace $namespace

Return Value

string

at line 72
string printClosure(Closure $closure, PhpNamespace $namespace = null)

No description

Parameters

Closure $closure
PhpNamespace $namespace

Return Value

string

at line 94
string printArrowFunction(Closure $closure, PhpNamespace $namespace = null)

No description

Parameters

Closure $closure
PhpNamespace $namespace

Return Value

string

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

No description

Parameters

Method $method
PhpNamespace $namespace

Return Value

string

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

No description

Parameters

ClassType $class
PhpNamespace $namespace

Return Value

string

at line 233
string printNamespace(PhpNamespace $namespace)

No description

Parameters

PhpNamespace $namespace

Return Value

string

at line 264
string printFile(PhpFile $file)

No description

Parameters

PhpFile $file

Return Value

string

at line 281
protected string printUses(PhpNamespace $namespace, string $of = PhpNamespace::NAME_NORMAL)

No description

Parameters

PhpNamespace $namespace
string $of

Return Value

string

at line 302
protected string printParameters(Closure|GlobalFunction|Method $function, int $column = 0)

No description

Parameters

Closure|GlobalFunction|Method $function
int $column

Return Value

string

at line 337
protected string printType(string|null $type, bool $nullable)

No description

Parameters

string|null $type
bool $nullable

Return Value

string

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

No description

Parameters

bool $state

Return Value

Printer

at line 391
protected string indent(string $s)

No description

Parameters

string $s

Return Value

string

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

No description

Parameters

$var
int $column

Return Value

string

Traits

Strict class for better experience.