PHP 클래스 Zend\Code\Generator\MethodGenerator

상속: extends Zend\Code\Generator\AbstractMemberGenerator
파일 보기 프로젝트 열기: zendframework/zend-code 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$body string
$docBlock Zend\Code\Generator\DocBlockGenerator
$parameters ParameterGenerator[]

공개 메소드들

메소드 설명
__construct ( string $name = null, array $parameters = [], integer $flags = self::FLAG_PUBLIC, string $body = null, Zend\Code\Generator\DocBlockGenerator | string $docBlock = null )
__toString ( )
fromArray ( array $array ) : MethodGenerator Generate from array
fromReflection ( Zend\Code\Reflection\MethodReflection $reflectionMethod ) : MethodGenerator
generate ( ) : string
getBody ( ) : string
getParameters ( ) : ParameterGenerator[]
getReturnType ( ) : TypeGenerator | null
setBody ( string $body ) : MethodGenerator
setParameter ( ParameterGenerator | array | string $parameter ) : MethodGenerator
setParameters ( array $parameters ) : MethodGenerator
setReturnType ( $returnType = null ) : MethodGenerator
setReturnsReference ( boolean $returnsReference ) : MethodGenerator

보호된 메소드들

메소드 설명
clearBodyIndention ( string $body ) : string Identify the space indention from the first line and remove this indention from all lines

비공개 메소드들

메소드 설명
expandLiteralType ( string $literalReturnType, ReflectionMethod $methodReflection ) : string
extractReturnTypeFromMethodReflection ( Zend\Code\Reflection\MethodReflection $methodReflection ) : null | string

메소드 상세

__construct() 공개 메소드

public __construct ( string $name = null, array $parameters = [], integer $flags = self::FLAG_PUBLIC, string $body = null, Zend\Code\Generator\DocBlockGenerator | string $docBlock = null )
$name string
$parameters array
$flags integer
$body string
$docBlock Zend\Code\Generator\DocBlockGenerator | string

__toString() 공개 메소드

public __toString ( )

clearBodyIndention() 보호된 정적인 메소드

Identify the space indention from the first line and remove this indention from all lines
protected static clearBodyIndention ( string $body ) : string
$body string
리턴 string

fromArray() 공개 정적인 메소드

Generate from array
public static fromArray ( array $array ) : MethodGenerator
$array array
리턴 MethodGenerator

fromReflection() 공개 정적인 메소드

public static fromReflection ( Zend\Code\Reflection\MethodReflection $reflectionMethod ) : MethodGenerator
$reflectionMethod Zend\Code\Reflection\MethodReflection
리턴 MethodGenerator

generate() 공개 메소드

public generate ( ) : string
리턴 string

getBody() 공개 메소드

public getBody ( ) : string
리턴 string

getParameters() 공개 메소드

public getParameters ( ) : ParameterGenerator[]
리턴 ParameterGenerator[]

getReturnType() 공개 메소드

public getReturnType ( ) : TypeGenerator | null
리턴 TypeGenerator | null

setBody() 공개 메소드

public setBody ( string $body ) : MethodGenerator
$body string
리턴 MethodGenerator

setParameter() 공개 메소드

public setParameter ( ParameterGenerator | array | string $parameter ) : MethodGenerator
$parameter ParameterGenerator | array | string
리턴 MethodGenerator

setParameters() 공개 메소드

public setParameters ( array $parameters ) : MethodGenerator
$parameters array
리턴 MethodGenerator

setReturnType() 공개 메소드

public setReturnType ( $returnType = null ) : MethodGenerator
리턴 MethodGenerator

setReturnsReference() 공개 메소드

public setReturnsReference ( boolean $returnsReference ) : MethodGenerator
$returnsReference boolean
리턴 MethodGenerator

프로퍼티 상세

$body 보호되어 있는 프로퍼티

protected string $body
리턴 string

$docBlock 보호되어 있는 프로퍼티

protected DocBlockGenerator,Zend\Code\Generator $docBlock
리턴 Zend\Code\Generator\DocBlockGenerator

$parameters 보호되어 있는 프로퍼티

protected ParameterGenerator[],Zend\Code\Generator $parameters
리턴 ParameterGenerator[]