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

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

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

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

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

Метод Описание
__construct ( string $name, mixed $func = null ) : FunctionGenerator Constructor
__toString ( ) : string Print method
addArgument ( string $name, mixed $value = null, string $type = null ) : FunctionGenerator Add a function argument
addArguments ( array $args ) : FunctionGenerator Add function arguments
addParameter ( string $name, mixed $value = null, string $type = null ) : FunctionGenerator Add a function argument (synonym method for convenience)
addParameters ( array $args ) : FunctionGenerator Add function arguments (synonym method for convenience)
appendToBody ( string $body, boolean $newline = true ) : FunctionGenerator Append to the function body
factory ( string $name, mixed $func = null ) : FunctionGenerator Static method to instantiate the function generator object and return itself to facilitate chaining methods together.
getArgument ( string $name ) : array Get a function argument
getArgumentNames ( ) : array Get the function arguments
getArguments ( ) : array Get the function arguments
getBody ( ) : string Get the function body
getDesc ( ) : string Get the function description
getDocblock ( ) : DocblockGenerator Access the docblock generator object
getIndent ( ) : string Get the function indent
getName ( ) : string Get the function name
getParameter ( string $name ) : array Get a function argument (synonym method for convenience)
getParameterNames ( ) : array Get the function arguments (synonym method for convenience)
getParameters ( ) : array Get the function arguments (synonym method for convenience)
isClosure ( ) : boolean Get the function closure flag
render ( boolean $ret = false ) : mixed Render method
setBody ( string $body, boolean $newline = true ) : FunctionGenerator Set the function body
setClosure ( boolean $closure = false ) : FunctionGenerator Set the function closure flag
setDesc ( string $desc = null ) : FunctionGenerator Set the function description
setDocblock ( DocblockGenerator $docblock ) : ClassGenerator Set the docblock generator object
setIndent ( string $indent = null ) : FunctionGenerator Set the function indent
setName ( string $name ) : FunctionGenerator Set the function name

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

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

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

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

Instantiate the function generator object
public __construct ( string $name, mixed $func = null ) : FunctionGenerator
$name string
$func mixed
Результат FunctionGenerator

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

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

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

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

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

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

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

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

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

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

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

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

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

Static method to instantiate the function generator object and return itself to facilitate chaining methods together.
public static factory ( string $name, mixed $func = null ) : FunctionGenerator
$name string
$func mixed
Результат FunctionGenerator

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Get the function closure flag
public isClosure ( ) : boolean
Результат boolean

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

Method to format the arguments
protected parseFunction ( mixed $func ) : void
$func mixed
Результат void

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

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

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

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

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

Set the function closure flag
public setClosure ( boolean $closure = false ) : FunctionGenerator
$closure boolean
Результат FunctionGenerator

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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