PHP Class Pop\Code\Generator\PropertyGenerator

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

Protected Properties

Property Type Description
$docblock DocblockGenerator Docblock generator object
$indent string Property indent
$name string Property name
$output string Property output
$static boolean Property static flag
$type string Property type
$value mixed Property value
$visibility string Property visibility

Public Methods

Method Description
__construct ( string $name, string $type, mixed $value = null, string $visibility = 'public' ) : PropertyGenerator Constructor
__toString ( ) : string Print property
factory ( string $name, string $type, mixed $value = null, string $visibility = 'public' ) : PropertyGenerator Static method to instantiate the property generator object and return itself to facilitate chaining methods together.
getDesc ( ) : string Get the property description
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the property indent
getName ( ) : string Get the property name
getType ( ) : string Get the property type
getValue ( ) : mixed Get the property value
getVisibility ( ) : string Get the property visibility
isStatic ( ) : boolean Get the property static flag
render ( boolean $ret = false ) : mixed Render property
setDesc ( string $desc = null ) : PropertyGenerator Set the property description
setDocblock ( DocblockGenerator $docblock ) : PropertyGenerator Set the docblock generator object
setIndent ( string $indent = null ) : PropertyGenerator Set the property indent
setName ( string $name ) : PropertyGenerator Set the property name
setStatic ( boolean $static = false ) : PropertyGenerator Set the property static flag
setType ( string $type ) : PropertyGenerator Set the property type
setValue ( mixed $value = null ) : PropertyGenerator Set the property value
setVisibility ( string $visibility = 'public' ) : PropertyGenerator Set the property visibility

Protected Methods

Method Description
formatArrayValues ( ) : string Format array value

Method Details

__construct() public method

Instantiate the property generator object
public __construct ( string $name, string $type, mixed $value = null, string $visibility = 'public' ) : PropertyGenerator
$name string
$type string
$value mixed
$visibility string
return PropertyGenerator

__toString() public method

Print property
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 $name, string $type, mixed $value = null, string $visibility = 'public' ) : PropertyGenerator
$name string
$type string
$value mixed
$visibility string
return PropertyGenerator

formatArrayValues() protected method

Format array value
protected formatArrayValues ( ) : string
return string

getDesc() public method

Get the property description
public getDesc ( ) : string
return string

getDocblock() public method

Access the docblock generator object
public getDocblock ( ) : DocblockGenerator
return DocblockGenerator

getIndent() public method

Get the property indent
public getIndent ( ) : string
return string

getName() public method

Get the property name
public getName ( ) : string
return string

getType() public method

Get the property type
public getType ( ) : string
return string

getValue() public method

Get the property value
public getValue ( ) : mixed
return mixed

getVisibility() public method

Get the property visibility
public getVisibility ( ) : string
return string

isStatic() public method

Get the property static flag
public isStatic ( ) : boolean
return boolean

render() public method

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

setDesc() public method

Set the property description
public setDesc ( string $desc = null ) : PropertyGenerator
$desc string
return PropertyGenerator

setDocblock() public method

Set the docblock generator object
public setDocblock ( DocblockGenerator $docblock ) : PropertyGenerator
$docblock DocblockGenerator
return PropertyGenerator

setIndent() public method

Set the property indent
public setIndent ( string $indent = null ) : PropertyGenerator
$indent string
return PropertyGenerator

setName() public method

Set the property name
public setName ( string $name ) : PropertyGenerator
$name string
return PropertyGenerator

setStatic() public method

Set the property static flag
public setStatic ( boolean $static = false ) : PropertyGenerator
$static boolean
return PropertyGenerator

setType() public method

Set the property type
public setType ( string $type ) : PropertyGenerator
$type string
return PropertyGenerator

setValue() public method

Set the property value
public setValue ( mixed $value = null ) : PropertyGenerator
$value mixed
return PropertyGenerator

setVisibility() public method

Set the property visibility
public setVisibility ( string $visibility = 'public' ) : PropertyGenerator
$visibility string
return PropertyGenerator

Property Details

$docblock protected property

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

$indent protected property

Property indent
protected string $indent
return string

$name protected property

Property name
protected string $name
return string

$output protected property

Property output
protected string $output
return string

$static protected property

Property static flag
protected bool $static
return boolean

$type protected property

Property type
protected string $type
return string

$value protected property

Property value
protected mixed $value
return mixed

$visibility protected property

Property visibility
protected string $visibility
return string