PHP 클래스 Pop\Code\Generator\FunctionGenerator

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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