Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MethodGenerator Class Reference

Public Member Functions

 __construct ($name=null, array $parameters=[], $flags=self::FLAG_PUBLIC, $body=null, $docBlock=null)
 
 setParameters (array $parameters)
 
 setParameter ($parameter)
 
 getParameters ()
 
 setBody ($body)
 
 getBody ()
 
 setReturnType ($returnType=null)
 
 setReturnsReference ($returnsReference)
 
 generate ()
 
 __toString ()
 
- Public Member Functions inherited from AbstractMemberGenerator
 setFlags ($flags)
 
 addFlag ($flag)
 
 removeFlag ($flag)
 
 setAbstract ($isAbstract)
 
 isAbstract ()
 
 setInterface ($isInterface)
 
 isInterface ()
 
 setFinal ($isFinal)
 
 isFinal ()
 
 setStatic ($isStatic)
 
 isStatic ()
 
 setVisibility ($visibility)
 
 getVisibility ()
 
 setName ($name)
 
 getName ()
 
 setDocBlock ($docBlock)
 
 getDocBlock ()
 
- Public Member Functions inherited from AbstractGenerator
 __construct ($options=[])
 
 setSourceDirty ($isSourceDirty=true)
 
 isSourceDirty ()
 
 setIndentation ($indentation)
 
 getIndentation ()
 
 setSourceContent ($sourceContent)
 
 getSourceContent ()
 
 setOptions ($options)
 

Static Public Member Functions

static fromReflection (MethodReflection $reflectionMethod)
 
static fromArray (array $array)
 Generate from array.
 

Static Protected Member Functions

static clearBodyIndention ($body)
 Identify the space indention from the first line and remove this indention from all lines.
 

Protected Attributes

 $docBlock = null
 
 $parameters = []
 
 $body = null
 
- Protected Attributes inherited from AbstractMemberGenerator
 $docBlock = null
 
 $name = null
 
 $flags = self::FLAG_PUBLIC
 
- Protected Attributes inherited from AbstractGenerator
 $isSourceDirty = true
 
 $indentation = ' '
 
 $sourceContent = null
 

Additional Inherited Members

- Public Attributes inherited from AbstractMemberGenerator
const FLAG_ABSTRACT = 0x01
 #@+ int Flags for construction usage
 
const FLAG_FINAL = 0x02
 
const FLAG_STATIC = 0x04
 
const FLAG_INTERFACE = 0x08
 
const FLAG_PUBLIC = 0x10
 
const FLAG_PROTECTED = 0x20
 
const FLAG_PRIVATE = 0x40
 
const VISIBILITY_PUBLIC = 'public'
 #@-
 
const VISIBILITY_PROTECTED = 'protected'
 
const VISIBILITY_PRIVATE = 'private'
 

Constructor & Destructor Documentation

__construct (   $name = null,
array  $parameters = [],
  $flags = self::FLAG_PUBLIC,
  $body = null,
  $docBlock = null 
)
Parameters
string$name
array$parameters
int$flags
string$body
DocBlockGenerator | string$docBlock

Member Function Documentation

__toString ( )
static clearBodyIndention (   $body)
staticprotected

Identify the space indention from the first line and remove this indention from all lines.

Parameters
string$body
Returns
string
static fromArray ( array  $array)
static

Generate from array.

name string [required] Class Name docblock string The docblock information flags int Flags, one of MethodGenerator::FLAG_ABSTRACT MethodGenerator::FLAG_FINAL parameters string Class which this class is extending body string abstract bool final bool static bool visibility string

Exceptions
Exception\InvalidArgumentException
Parameters
array$array
Returns
MethodGenerator
static fromReflection ( MethodReflection  $reflectionMethod)
static
Parameters
MethodReflection$reflectionMethod
Returns
MethodGenerator
generate ( )
Returns
string

Implements GeneratorInterface.

getBody ( )
Returns
string
getParameters ( )
setBody (   $body)
Parameters
string$body
Returns
MethodGenerator
setParameter (   $parameter)
Parameters
ParameterGenerator | array | string$parameter
Exceptions
Exception\InvalidArgumentException
Returns
MethodGenerator
setParameters ( array  $parameters)
Parameters
array$parameters
Returns
MethodGenerator
setReturnsReference (   $returnsReference)
Parameters
bool$returnsReference
Returns
MethodGenerator
setReturnType (   $returnType = null)
Parameters
string|null
Returns
MethodGenerator

Member Data Documentation

$body = null
protected
$docBlock = null
protected
$parameters = []
protected