PHP Class Pop\Code\Generator\NamespaceGenerator

Author: Nick Sagona, III ([email protected])
Inheritance: implements Pop\Code\Generator\GeneratorInterface
显示文件 Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$docblock DocblockGenerator Docblock generator object
$indent string Namespace indent
$namespace string Namespace
$output string Namespace output
$use array Array of namespaces to use

Public Methods

Method Description
__construct ( string $namespace ) : NamespaceGenerator Constructor
__toString ( ) : string Print namespace
factory ( string $namespace ) : NamespaceGenerator Static method to instantiate the property generator object and return itself to facilitate chaining methods together.
getNamespace ( ) : string Get the namespace
render ( boolean $ret = false ) : mixed Render property
setNamespace ( string $namespace ) : NamespaceGenerator Set the namespace
setUse ( string $use, string $as = null ) : NamespaceGenerator Set a namespace to use
setUses ( array $uses ) : NamespaceGenerator Set namespaces to use

Method Details

__construct() public method

Instantiate the property generator object
public __construct ( string $namespace ) : NamespaceGenerator
$namespace string
return NamespaceGenerator

__toString() public method

Print namespace
public __toString ( ) : string
return string

factory() public static method

Static method to instantiate the property generator object and return itself to facilitate chaining methods together.
public static factory ( string $namespace ) : NamespaceGenerator
$namespace string
return NamespaceGenerator

getNamespace() public method

Get the namespace
public getNamespace ( ) : string
return string

render() public method

Render property
public render ( boolean $ret = false ) : mixed
$ret boolean
return mixed

setNamespace() public method

Set the namespace
public setNamespace ( string $namespace ) : NamespaceGenerator
$namespace string
return NamespaceGenerator

setUse() public method

Set a namespace to use
public setUse ( string $use, string $as = null ) : NamespaceGenerator
$use string
$as string
return NamespaceGenerator

setUses() public method

Set namespaces to use
public setUses ( array $uses ) : NamespaceGenerator
$uses array
return NamespaceGenerator

Property Details

$docblock protected_oe property

Docblock generator object
protected DocblockGenerator,Pop\Code\Generator $docblock
return DocblockGenerator

$indent protected_oe property

Namespace indent
protected string $indent
return string

$namespace protected_oe property

Namespace
protected string $namespace
return string

$output protected_oe property

Namespace output
protected string $output
return string

$use protected_oe property

Array of namespaces to use
protected array $use
return array