final class PhpFile

Instance of PHP file.

Generates:

  • opening tag (<?php)
  • doc comments
  • one or more namespaces

Methods

addClass(string $name)

No description

addInterface(string $name)

No description

addTrait(string $name)

No description

addNamespace(string $name)

No description

array
getNamespaces()

No description

addUse(string $name, string $alias = null)

No description

setStrictTypes(bool $on = true)

Adds declare(strict_types=1) to output.

bool
hasStrictTypes()

No description

bool
getStrictTypes() deprecated

No description

string
__toString()

No description

Details

at line 35
ClassType addClass(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 43
ClassType addInterface(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 51
ClassType addTrait(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 59
PhpNamespace addNamespace(string $name)

No description

Parameters

string $name

Return Value

PhpNamespace

at line 72
array getNamespaces()

No description

Return Value

array

at line 79
PhpFile addUse(string $name, string $alias = null)

No description

Parameters

string $name
string $alias

Return Value

PhpFile

at line 90
PhpFile setStrictTypes(bool $on = true)

Adds declare(strict_types=1) to output.

Parameters

bool $on

Return Value

PhpFile

at line 97
bool hasStrictTypes()

No description

Return Value

bool

at line 104
bool getStrictTypes() deprecated

deprecated use hasStrictTypes()

No description

Return Value

bool

at line 110
string __toString()

No description

Return Value

string

Traits

SmartObject