PHP Class Pop\Code\Generator\InterfaceGenerator

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$docblock DocblockGenerator Docblock generator object
$indent string Class indent
$methods array Array of method generator objects
$name string Class name
$namespace NamespaceGenerator Namespace generator object
$output string Class output
$parent string Parent interface that is extended

Public Methods

Method Description
__construct ( string $name, string $parent = null ) : InterfaceGenerator Constructor
__toString ( ) : string Print method
addMethod ( MethodGenerator $method ) : ClassGenerator Add a class method
factory ( string $name, string $parent = null ) : InterfaceGenerator Static method to instantiate the interface generator object and return itself to facilitate chaining methods together.
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the interface indent
getMethod ( mixed $method ) : /Pop\Code\MethodGenerator Get a method property
getName ( ) : string Get the interface name
getNamespace ( ) : NamespaceGenerator Access the namespace generator object
getParent ( ) : string Get the interface parent
removeMethod ( mixed $method ) : ClassGenerator Remove a method property
render ( boolean $ret = false ) : mixed Render method
setDocblock ( DocblockGenerator $docblock ) : ClassGenerator Set the docblock generator object
setIndent ( string $indent = null ) : InterfaceGenerator Set the interface indent
setName ( string $name ) : InterfaceGenerator Set the interface name
setNamespace ( NamespaceGenerator $namespace ) : ClassGenerator Set the namespace generator object
setParent ( string $parent = null ) : InterfaceGenerator Set the interface parent

Protected Methods

Method Description
formatMethods ( ) : string Method to format the methods

Method Details

__construct() public method

Instantiate the interface generator object
public __construct ( string $name, string $parent = null ) : InterfaceGenerator
$name string
$parent string
return InterfaceGenerator

__toString() public method

Print method
public __toString ( ) : string
return string

addMethod() public method

Add a class method
public addMethod ( MethodGenerator $method ) : ClassGenerator
$method MethodGenerator
return ClassGenerator

factory() public static method

Static method to instantiate the interface generator object and return itself to facilitate chaining methods together.
public static factory ( string $name, string $parent = null ) : InterfaceGenerator
$name string
$parent string
return InterfaceGenerator

formatMethods() protected method

Method to format the methods
protected formatMethods ( ) : string
return string

getDocblock() public method

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

getIndent() public method

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

getMethod() public method

Get a method property
public getMethod ( mixed $method ) : /Pop\Code\MethodGenerator
$method mixed
return /Pop\Code\MethodGenerator

getName() public method

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

getNamespace() public method

Access the namespace generator object
public getNamespace ( ) : NamespaceGenerator
return NamespaceGenerator

getParent() public method

Get the interface parent
public getParent ( ) : string
return string

removeMethod() public method

Remove a method property
public removeMethod ( mixed $method ) : ClassGenerator
$method mixed
return ClassGenerator

render() public method

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

setDocblock() public method

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

setIndent() public method

Set the interface indent
public setIndent ( string $indent = null ) : InterfaceGenerator
$indent string
return InterfaceGenerator

setName() public method

Set the interface name
public setName ( string $name ) : InterfaceGenerator
$name string
return InterfaceGenerator

setNamespace() public method

Set the namespace generator object
public setNamespace ( NamespaceGenerator $namespace ) : ClassGenerator
$namespace NamespaceGenerator
return ClassGenerator

setParent() public method

Set the interface parent
public setParent ( string $parent = null ) : InterfaceGenerator
$parent string
return InterfaceGenerator

Property Details

$docblock protected property

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

$indent protected property

Class indent
protected string $indent
return string

$methods protected property

Array of method generator objects
protected array $methods
return array

$name protected property

Class name
protected string $name
return string

$namespace protected property

Namespace generator object
protected NamespaceGenerator,Pop\Code\Generator $namespace
return NamespaceGenerator

$output protected property

Class output
protected string $output
return string

$parent protected property

Parent interface that is extended
protected string $parent
return string