class PhpNamespace

Namespaced part of a PHP file.

Generates: - namespace statement - variable amount of use statements - one or more class declarations

Traits

Strict class for better experience.

Constants

KEYWORDS

Methods

__construct(string $name)

No description

string
getName()

No description

setBracketedSyntax(bool $state = true)

No description

bool
hasBracketedSyntax()

No description

bool
getBracketedSyntax() deprecated

No description

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

No description

array
getUses()

No description

string
unresolveName(string $name)

No description

add(ClassType $class)

No description

addClass(string $name)

No description

addInterface(string $name)

No description

addTrait(string $name)

No description

array
getClasses()

No description

string
__toString()

No description

Details

at line 48
__construct(string $name)

Parameters

string $name

at line 57
string getName()

Return Value

string

at line 67
PhpNamespace setBracketedSyntax(bool $state = true)

Parameters

bool $state

Return Value

PhpNamespace

at line 74
bool hasBracketedSyntax()

Return Value

bool

at line 81
bool getBracketedSyntax() deprecated

deprecated use hasBracketedSyntax()

Return Value

bool

at line 91
PhpNamespace addUse(string $name, string $alias = null, string $aliasOut = null)

Parameters

string $name
string $alias
string $aliasOut

Return Value

PhpNamespace

Exceptions

InvalidStateException

at line 123
array getUses()

Return Value

array

at line 129
string unresolveName(string $name)

Parameters

string $name

Return Value

string

at line 155
PhpNamespace add(ClassType $class)

Parameters

ClassType $class

Return Value

PhpNamespace

at line 167
ClassType addClass(string $name)

Parameters

string $name

Return Value

ClassType

at line 174
ClassType addInterface(string $name)

Parameters

string $name

Return Value

ClassType

at line 180
ClassType addTrait(string $name)

Parameters

string $name

Return Value

ClassType

at line 187
array getClasses()

Return Value

array

at line 193
string __toString()

Return Value

string