PHP Класс Pop\Code\Generator\ClassGenerator

Автор: Nick Sagona, III ([email protected])
Наследование: implements Pop\Code\Generator\GeneratorInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
formatMethods ( ) : string Method to format the methods
formatProperties ( ) : string Method to format the properties

Описание методов

__construct() публичный Метод

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
Результат ClassGenerator

__toString() публичный Метод

Print method
public __toString ( ) : string
Результат string

addMethod() публичный Метод

Add a class method
public addMethod ( MethodGenerator $method ) : ClassGenerator
$method MethodGenerator
Результат ClassGenerator

addProperty() публичный Метод

Add a class property
public addProperty ( PropertyGenerator $property ) : ClassGenerator
$property PropertyGenerator
Результат ClassGenerator

factory() публичный статический Метод

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
Результат ClassGenerator

formatMethods() защищенный Метод

Method to format the methods
protected formatMethods ( ) : string
Результат string

formatProperties() защищенный Метод

Method to format the properties
protected formatProperties ( ) : string
Результат string

getDocblock() публичный Метод

Access the docblock generator object
public getDocblock ( ) : DocblockGenerator
Результат DocblockGenerator

getIndent() публичный Метод

Get the class indent
public getIndent ( ) : string
Результат string

getInterface() публичный Метод

Get the class interface
public getInterface ( ) : string
Результат string

getMethod() публичный Метод

Get a method property
public getMethod ( mixed $method ) : MethodGenerator
$method mixed
Результат MethodGenerator

getMethods() публичный Метод

Get all methods
public getMethods ( ) : array
Результат array

getName() публичный Метод

Get the class name
public getName ( ) : string
Результат string

getNamespace() публичный Метод

Access the namespace generator object
public getNamespace ( ) : NamespaceGenerator
Результат NamespaceGenerator

getParent() публичный Метод

Get the class parent
public getParent ( ) : string
Результат string

getProperties() публичный Метод

Get all properties
public getProperties ( ) : array
Результат array

getProperty() публичный Метод

Get a class property
public getProperty ( mixed $property ) : PropertyGenerator
$property mixed
Результат PropertyGenerator

isAbstract() публичный Метод

Get the class abstract flag
public isAbstract ( ) : boolean
Результат boolean

removeMethod() публичный Метод

Remove a method property
public removeMethod ( mixed $method ) : ClassGenerator
$method mixed
Результат ClassGenerator

removeProperty() публичный Метод

Remove a class property
public removeProperty ( mixed $property ) : ClassGenerator
$property mixed
Результат ClassGenerator

render() публичный Метод

Render method
public render ( boolean $ret = false ) : mixed
$ret boolean
Результат mixed

setAbstract() публичный Метод

Set the class abstract flag
public setAbstract ( boolean $abstract = false ) : ClassGenerator
$abstract boolean
Результат ClassGenerator

setDocblock() публичный Метод

Set the docblock generator object
public setDocblock ( DocblockGenerator $docblock ) : ClassGenerator
$docblock DocblockGenerator
Результат ClassGenerator

setIndent() публичный Метод

Set the class indent
public setIndent ( string $indent = null ) : ClassGenerator
$indent string
Результат ClassGenerator

setInterface() публичный Метод

Set the class interface
public setInterface ( string $interface = null ) : ClassGenerator
$interface string
Результат ClassGenerator

setName() публичный Метод

Set the class name
public setName ( string $name ) : ClassGenerator
$name string
Результат ClassGenerator

setNamespace() публичный Метод

Set the namespace generator object
public setNamespace ( NamespaceGenerator $namespace ) : ClassGenerator
$namespace NamespaceGenerator
Результат ClassGenerator

setParent() публичный Метод

Set the class parent
public setParent ( string $parent = null ) : ClassGenerator
$parent string
Результат ClassGenerator

Описание свойств

$abstract защищенное свойство

Class abstract flag
protected bool $abstract
Результат boolean

$docblock защищенное свойство

Docblock generator object
protected DocblockGenerator,Pop\Code\Generator $docblock
Результат DocblockGenerator

$indent защищенное свойство

Class indent
protected string $indent
Результат string

$interface защищенное свойство

Interface that is implemented
protected string $interface
Результат string

$methods защищенное свойство

Array of method generator objects
protected array $methods
Результат array

$name защищенное свойство

Class name
protected string $name
Результат string

$namespace защищенное свойство

Namespace generator object
protected NamespaceGenerator,Pop\Code\Generator $namespace
Результат NamespaceGenerator

$output защищенное свойство

Class output
protected string $output
Результат string

$parent защищенное свойство

Parent class that is extended
protected string $parent
Результат string

$properties защищенное свойство

Array of property generator objects
protected array $properties
Результат array