Class MethodGenerator

Summary

Fully Qualified Name: Laminas\Code\Generator\MethodGenerator
Extends: AbstractMemberGenerator

Description

Methods

Name Description Defined By
__construct() MethodGenerator
__toString() MethodGenerator
addFlag() AbstractMemberGenerator
copyMethodSignature() Returns a MethodGenerator based on a MethodReflection with only the signature copied. MethodGenerator
fromArray() Generate from array MethodGenerator
fromReflection() MethodGenerator
generate() MethodGenerator
getBody() MethodGenerator
getDocBlock() AbstractMemberGenerator
getIndentation() AbstractGenerator
getName() AbstractMemberGenerator
getParameters() MethodGenerator
getReturnType() MethodGenerator
getSourceContent() AbstractGenerator
getVisibility() AbstractMemberGenerator
isAbstract() AbstractMemberGenerator
isFinal() AbstractMemberGenerator
isInterface() AbstractMemberGenerator
isSourceDirty() AbstractGenerator
isStatic() AbstractMemberGenerator
removeDocBlock() AbstractMemberGenerator
removeFlag() AbstractMemberGenerator
setAbstract() AbstractMemberGenerator
setBody() MethodGenerator
setDocBlock() AbstractMemberGenerator
setFinal() AbstractMemberGenerator
setFlags() AbstractMemberGenerator
setIndentation() AbstractGenerator
setInterface() AbstractMemberGenerator
setName() AbstractMemberGenerator
setOptions() AbstractGenerator
setParameter() MethodGenerator
setParameters() MethodGenerator
setReturnType() MethodGenerator
setReturnsReference() MethodGenerator
setSourceContent() AbstractGenerator
setSourceDirty() AbstractGenerator
setStatic() AbstractMemberGenerator
setVisibility() AbstractMemberGenerator

Method Details

__construct()

Parameter Name Type Description
$name string
$parameters array
$flags int
$body string
$docBlock \DocBlockGenerator|string

Returns:

__toString()

Returns: void

addFlag()

Parameter Name Type Description
$flag int

Returns: \AbstractMemberGenerator

copyMethodSignature()

Returns a MethodGenerator based on a MethodReflection with only the signature copied.

This is similar to fromReflection() but without the method body and phpdoc as this is quite heavy to copy. It's for example useful when creating proxies where you normally change the method body anyway.

Parameter Name Type Description
$reflectionMethod

Returns:

fromArray()

Generate from array

Parameter Name Type Description
$array array

Returns: \MethodGenerator

fromReflection()

Parameter Name Type Description
$reflectionMethod \MethodReflection

Returns: \MethodGenerator

generate()

Returns: string

getBody()

Returns: string

getDocBlock()

Returns: \DocBlockGenerator|null

getIndentation()

Returns: string

getName()

Returns: string

getParameters()

Returns: \ParameterGenerator[]

getReturnType()

Returns: \TypeGenerator|null

getSourceContent()

Returns: string

getVisibility()

Returns: string

isAbstract()

Returns: bool

isFinal()

Returns: bool

isInterface()

Returns: bool

isSourceDirty()

Returns: bool

isStatic()

Returns: bool

removeDocBlock()

Returns: void

removeFlag()

Parameter Name Type Description
$flag int

Returns: \AbstractMemberGenerator

setAbstract()

Parameter Name Type Description
$isAbstract bool

Returns: \AbstractMemberGenerator

setBody()

Parameter Name Type Description
$body string

Returns: \MethodGenerator

setDocBlock()

Parameter Name Type Description
$docBlock \DocBlockGenerator|string

Returns: \AbstractMemberGenerator

setFinal()

Parameter Name Type Description
$isFinal bool

Returns: \AbstractMemberGenerator

setFlags()

Parameter Name Type Description
$flags int|array

Returns: \AbstractMemberGenerator

setIndentation()

Parameter Name Type Description
$indentation string

Returns: \AbstractGenerator

setInterface()

Parameter Name Type Description
$isInterface bool

Returns: \AbstractMemberGenerator

setName()

Parameter Name Type Description
$name string

Returns: \AbstractMemberGenerator

setOptions()

Parameter Name Type Description
$options array|\Traversable

Returns: \AbstractGenerator

setParameter()

Parameter Name Type Description
$parameter \ParameterGenerator|array|string

Returns: \MethodGenerator

setParameters()

Parameter Name Type Description
$parameters array

Returns: \MethodGenerator

setReturnType()

Parameter Name Type Description
$returnType string|null

Returns: \MethodGenerator

setReturnsReference()

Parameter Name Type Description
$returnsReference bool

Returns: \MethodGenerator

setSourceContent()

Parameter Name Type Description
$sourceContent string

Returns: \AbstractGenerator

setSourceDirty()

Parameter Name Type Description
$isSourceDirty bool

Returns: \AbstractGenerator

setStatic()

Parameter Name Type Description
$isStatic bool

Returns: \AbstractMemberGenerator

setVisibility()

Parameter Name Type Description
$visibility string

Returns: \AbstractMemberGenerator

Top