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

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

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

Свойство Тип Описание
$abstract boolean Method abstract flag
$arguments array Method arguments
$body string Method body
$docblock DocblockGenerator Docblock generator object
$final boolean Method final flag
$indent string Method indent
$interface boolean Method interface flag
$name string Method name
$output string Method output
$static boolean Method static flag
$visibility string Method visibility

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

Метод Описание
__construct ( string $name, string $visibility = 'public', boolean $static = false ) : MethodGenerator Constructor
__toString ( ) : string Print method
addArgument ( string $name, mixed $value = null, string $type = null ) : MethodGenerator Add a method argument
addArguments ( array $args ) : MethodGenerator Add method arguments
addParameter ( string $name, mixed $value = null, string $type = null ) : MethodGenerator Add a method argument (synonym method for convenience)
addParameters ( array $args ) : MethodGenerator Add method arguments (synonym method for convenience)
appendToBody ( string $body, boolean $newline = true ) : MethodGenerator Append to the method body
factory ( string $name, string $visibility = 'public', boolean $static = false ) : MethodGenerator Static method to instantiate the method generator object and return itself to facilitate chaining methods together.
getArgument ( string $name ) : array Get a method argument
getArguments ( ) : array Get the method arguments
getBody ( ) : string Get the method body
getDesc ( ) : string Get the method description
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the method indent
getName ( ) : string Get the method name
getParameter ( string $name ) : array Get a method argument (synonym method for convenience)
getParameters ( ) : array Get the method arguments (synonym method for convenience)
getVisibility ( ) : string Get the method visibility
isAbstract ( ) : boolean Get the method abstract flag
isFinal ( ) : boolean Get the method final flag
isInterface ( ) : boolean Get the method interface flag
isStatic ( ) : boolean Get the method static flag
render ( boolean $ret = false ) : mixed Render method
setAbstract ( boolean $abstract = false ) : MethodGenerator Set the method abstract flag
setBody ( string $body, boolean $newline = true ) : MethodGenerator Set the method body
setDesc ( string $desc = null ) : MethodGenerator Set the method description
setDocblock ( DocblockGenerator $docblock ) : ClassGenerator Set the docblock generator object
setFinal ( boolean $final = false ) : MethodGenerator Set the method final flag
setIndent ( string $indent = null ) : MethodGenerator Set the method indent
setInterface ( boolean $interface = false ) : MethodGenerator Set the method interface flag
setName ( string $name ) : MethodGenerator Set the method name
setStatic ( boolean $static = false ) : MethodGenerator Set the method static flag
setVisibility ( string $visibility = 'public' ) : MethodGenerator Set the method visibility

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

Метод Описание
formatArguments ( ) : string Method to format the arguments

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

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

Instantiate the method generator object
public __construct ( string $name, string $visibility = 'public', boolean $static = false ) : MethodGenerator
$name string
$visibility string
$static boolean
Результат MethodGenerator

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

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

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

Add a method argument
public addArgument ( string $name, mixed $value = null, string $type = null ) : MethodGenerator
$name string
$value mixed
$type string
Результат MethodGenerator

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

Add method arguments
public addArguments ( array $args ) : MethodGenerator
$args array
Результат MethodGenerator

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

Add a method argument (synonym method for convenience)
public addParameter ( string $name, mixed $value = null, string $type = null ) : MethodGenerator
$name string
$value mixed
$type string
Результат MethodGenerator

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

Add method arguments (synonym method for convenience)
public addParameters ( array $args ) : MethodGenerator
$args array
Результат MethodGenerator

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

Append to the method body
public appendToBody ( string $body, boolean $newline = true ) : MethodGenerator
$body string
$newline boolean
Результат MethodGenerator

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

Static method to instantiate the method generator object and return itself to facilitate chaining methods together.
public static factory ( string $name, string $visibility = 'public', boolean $static = false ) : MethodGenerator
$name string
$visibility string
$static boolean
Результат MethodGenerator

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

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

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

Get a method argument
public getArgument ( string $name ) : array
$name string
Результат array

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

Get the method arguments
public getArguments ( ) : array
Результат array

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

Get the method body
public getBody ( ) : string
Результат string

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

Get the method description
public getDesc ( ) : string
Результат string

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

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

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

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

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

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

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

Get a method argument (synonym method for convenience)
public getParameter ( string $name ) : array
$name string
Результат array

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

Get the method arguments (synonym method for convenience)
public getParameters ( ) : array
Результат array

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

Get the method visibility
public getVisibility ( ) : string
Результат string

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

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

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

Get the method final flag
public isFinal ( ) : boolean
Результат boolean

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

Get the method interface flag
public isInterface ( ) : boolean
Результат boolean

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

Get the method static flag
public isStatic ( ) : boolean
Результат boolean

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

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

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

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

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

Set the method body
public setBody ( string $body, boolean $newline = true ) : MethodGenerator
$body string
$newline boolean
Результат MethodGenerator

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

Set the method description
public setDesc ( string $desc = null ) : MethodGenerator
$desc string
Результат MethodGenerator

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

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

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

Set the method final flag
public setFinal ( boolean $final = false ) : MethodGenerator
$final boolean
Результат MethodGenerator

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

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

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

Set the method interface flag
public setInterface ( boolean $interface = false ) : MethodGenerator
$interface boolean
Результат MethodGenerator

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

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

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

Set the method static flag
public setStatic ( boolean $static = false ) : MethodGenerator
$static boolean
Результат MethodGenerator

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

Set the method visibility
public setVisibility ( string $visibility = 'public' ) : MethodGenerator
$visibility string
Результат MethodGenerator

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

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

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

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

Method arguments
protected array $arguments
Результат array

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

Method body
protected string $body
Результат string

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

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

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

Method final flag
protected bool $final
Результат boolean

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

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

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

Method interface flag
protected bool $interface
Результат boolean

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

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

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

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

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

Method static flag
protected bool $static
Результат boolean

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

Method visibility
protected string $visibility
Результат string