class PhpNamespace

Namespaced part of a PHP file.

Generates:

  • namespace statement
  • variable amount of use statements
  • one or more class declarations

Methods

__construct($name = NULL)

No description

setName($name) deprecated

No description

string|null
getName()

No description

setBracketedSyntax($state = TRUE)

No description

bool
getBracketedSyntax()

No description

addUse($name, $alias = NULL, $aliasOut = NULL)

No description

string[]
getUses()

No description

string
unresolveName($name)

No description

addClass($name)

No description

addInterface($name)

No description

addTrait($name)

No description

getClasses()

No description

string
__toString()

No description

Details

at line 40
__construct($name = NULL)

No description

Parameters

$name

at line 47
setName($name) deprecated

deprecated

No description

Parameters

$name

at line 57
string|null getName()

No description

Return Value

string|null

at line 68
PhpNamespace setBracketedSyntax($state = TRUE)

internal  
 

No description

Parameters

$state

Return Value

PhpNamespace

at line 78
bool getBracketedSyntax()

No description

Return Value

bool

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

No description

Parameters

$name
$alias
$aliasOut

Return Value

PhpNamespace

Exceptions

InvalidStateException

at line 124
string[] getUses()

No description

Return Value

string[]

at line 134
string unresolveName($name)

No description

Parameters

$name

Return Value

string

at line 163
ClassType addClass($name)

No description

Parameters

$name

Return Value

ClassType

at line 177
ClassType addInterface($name)

No description

Parameters

$name

Return Value

ClassType

at line 187
ClassType addTrait($name)

No description

Parameters

$name

Return Value

ClassType

at line 196
ClassType[] getClasses()

No description

Return Value

ClassType[]

at line 205
string __toString()

No description

Return Value

string

PHP code

Traits

SmartObject