PHP Class Pop\Code\Generator\ClassGenerator

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

Protected Properties

Свойство Type Description
$abstract boolean Class abstract flag
$docblock DocblockGenerator Docblock generator object
$indent string Class indent
$interface string Interface that is implemented
$methods array Array of method generator objects
$name string Class name
$namespace NamespaceGenerator Namespace generator object
$output string Class output
$parent string Parent class that is extended
$properties array Array of property generator objects

Méthodes publiques

Méthode Description
__construct ( string $name, string $parent = null, string $interface = null, boolean $abstract = false ) : ClassGenerator Constructor
__toString ( ) : string Print method
addMethod ( MethodGenerator $method ) : ClassGenerator Add a class method
addProperty ( PropertyGenerator $property ) : ClassGenerator Add a class property
factory ( string $name, string $parent = null, string $interface = null, boolean $abstract = false ) : ClassGenerator Static method to instantiate the class generator object and return itself to facilitate chaining methods together.
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the class indent
getInterface ( ) : string Get the class interface
getMethod ( mixed $method ) : MethodGenerator Get a method property
getMethods ( ) : array Get all methods
getName ( ) : string Get the class name
getNamespace ( ) : NamespaceGenerator Access the namespace generator object
getParent ( ) : string Get the class parent
getProperties ( ) : array Get all properties
getProperty ( mixed $property ) : PropertyGenerator Get a class property
isAbstract ( ) : boolean Get the class abstract flag
removeMethod ( mixed $method ) : ClassGenerator Remove a method property
removeProperty ( mixed $property ) : ClassGenerator Remove a class property
render ( boolean $ret = false ) : mixed Render method
setAbstract ( boolean $abstract = false ) : ClassGenerator Set the class abstract flag
setDocblock ( DocblockGenerator $docblock ) : ClassGenerator Set the docblock generator object
setIndent ( string $indent = null ) : ClassGenerator Set the class indent
setInterface ( string $interface = null ) : ClassGenerator Set the class interface
setName ( string $name ) : ClassGenerator Set the class name
setNamespace ( NamespaceGenerator $namespace ) : ClassGenerator Set the namespace generator object
setParent ( string $parent = null ) : ClassGenerator Set the class parent

Méthodes protégées

Méthode Description
formatMethods ( ) : string Method to format the methods
formatProperties ( ) : string Method to format the properties

Method Details

__construct() public méthode

Instantiate the class generator object
public __construct ( string $name, string $parent = null, string $interface = null, boolean $abstract = false ) : ClassGenerator
$name string
$parent string
$interface string
$abstract boolean
Résultat ClassGenerator

__toString() public méthode

Print method
public __toString ( ) : string
Résultat string

addMethod() public méthode

Add a class method
public addMethod ( MethodGenerator $method ) : ClassGenerator
$method MethodGenerator
Résultat ClassGenerator

addProperty() public méthode

Add a class property
public addProperty ( PropertyGenerator $property ) : ClassGenerator
$property PropertyGenerator
Résultat ClassGenerator

factory() public static méthode

Static method to instantiate the class generator object and return itself to facilitate chaining methods together.
public static factory ( string $name, string $parent = null, string $interface = null, boolean $abstract = false ) : ClassGenerator
$name string
$parent string
$interface string
$abstract boolean
Résultat ClassGenerator

formatMethods() protected méthode

Method to format the methods
protected formatMethods ( ) : string
Résultat string

formatProperties() protected méthode

Method to format the properties
protected formatProperties ( ) : string
Résultat string

getDocblock() public méthode

Access the docblock generator object
public getDocblock ( ) : DocblockGenerator
Résultat DocblockGenerator

getIndent() public méthode

Get the class indent
public getIndent ( ) : string
Résultat string

getInterface() public méthode

Get the class interface
public getInterface ( ) : string
Résultat string

getMethod() public méthode

Get a method property
public getMethod ( mixed $method ) : MethodGenerator
$method mixed
Résultat MethodGenerator

getMethods() public méthode

Get all methods
public getMethods ( ) : array
Résultat array

getName() public méthode

Get the class name
public getName ( ) : string
Résultat string

getNamespace() public méthode

Access the namespace generator object
public getNamespace ( ) : NamespaceGenerator
Résultat NamespaceGenerator

getParent() public méthode

Get the class parent
public getParent ( ) : string
Résultat string

getProperties() public méthode

Get all properties
public getProperties ( ) : array
Résultat array

getProperty() public méthode

Get a class property
public getProperty ( mixed $property ) : PropertyGenerator
$property mixed
Résultat PropertyGenerator

isAbstract() public méthode

Get the class abstract flag
public isAbstract ( ) : boolean
Résultat boolean

removeMethod() public méthode

Remove a method property
public removeMethod ( mixed $method ) : ClassGenerator
$method mixed
Résultat ClassGenerator

removeProperty() public méthode

Remove a class property
public removeProperty ( mixed $property ) : ClassGenerator
$property mixed
Résultat ClassGenerator

render() public méthode

Render method
public render ( boolean $ret = false ) : mixed
$ret boolean
Résultat mixed

setAbstract() public méthode

Set the class abstract flag
public setAbstract ( boolean $abstract = false ) : ClassGenerator
$abstract boolean
Résultat ClassGenerator

setDocblock() public méthode

Set the docblock generator object
public setDocblock ( DocblockGenerator $docblock ) : ClassGenerator
$docblock DocblockGenerator
Résultat ClassGenerator

setIndent() public méthode

Set the class indent
public setIndent ( string $indent = null ) : ClassGenerator
$indent string
Résultat ClassGenerator

setInterface() public méthode

Set the class interface
public setInterface ( string $interface = null ) : ClassGenerator
$interface string
Résultat ClassGenerator

setName() public méthode

Set the class name
public setName ( string $name ) : ClassGenerator
$name string
Résultat ClassGenerator

setNamespace() public méthode

Set the namespace generator object
public setNamespace ( NamespaceGenerator $namespace ) : ClassGenerator
$namespace NamespaceGenerator
Résultat ClassGenerator

setParent() public méthode

Set the class parent
public setParent ( string $parent = null ) : ClassGenerator
$parent string
Résultat ClassGenerator

Property Details

$abstract protected_oe property

Class abstract flag
protected bool $abstract
Résultat boolean

$docblock protected_oe property

Docblock generator object
protected DocblockGenerator,Pop\Code\Generator $docblock
Résultat DocblockGenerator

$indent protected_oe property

Class indent
protected string $indent
Résultat string

$interface protected_oe property

Interface that is implemented
protected string $interface
Résultat string

$methods protected_oe property

Array of method generator objects
protected array $methods
Résultat array

$name protected_oe property

Class name
protected string $name
Résultat string

$namespace protected_oe property

Namespace generator object
protected NamespaceGenerator,Pop\Code\Generator $namespace
Résultat NamespaceGenerator

$output protected_oe property

Class output
protected string $output
Résultat string

$parent protected_oe property

Parent class that is extended
protected string $parent
Résultat string

$properties protected_oe property

Array of property generator objects
protected array $properties
Résultat array