PHP Interface Phan\Language\Element\FunctionInterface

Inheritance: extends Phan\Language\Element\AddressableElementInterface
显示文件 Open project: etsy/phan Interface Usage Examples

Public Methods

Method Description
alternateGenerator ( CodeBase $code_base ) : Generator
analyze ( Context $context, CodeBase $code_base ) : Context
appendParameter ( Parameter $parameter ) : void
getFQSEN ( ) : FullyQualifiedMethodName | FullyQualifiedFunctionName
getHasReturn ( ) : boolean
getInternalScope ( ) : Phan\Language\Scope\ClosedScope
getNumberOfOptionalParameters ( ) : integer
getNumberOfParameters ( ) : integer
getNumberOfRequiredParameters ( ) : integer
getParameterForCaller ( integer $i ) : Parameter | null Gets the $ith parameter for the **caller**.
getParameterList ( ) : Parameter[]
isReturnTypeUndefined ( ) : boolean
setHasReturn ( boolean $has_return ) : void
setHasYield ( boolean $has_return ) : void
setInternalScope ( Phan\Language\Scope\ClosedScope $internal_scope ) : void
setIsReturnTypeUndefined ( boolean $is_return_type_undefined ) : void
setNumberOfOptionalParameters ( integer $number ) : void The number of optional parameters
setNumberOfRequiredParameters ( integer $number ) : void The number of required parameters
setParameterList ( array $parameter_list ) : void

Method Details

alternateGenerator() public method

public alternateGenerator ( CodeBase $code_base ) : Generator
$code_base Phan\CodeBase
return Generator The set of all alternates to this function

analyze() public method

public analyze ( Context $context, CodeBase $code_base ) : Context
$context Phan\Language\Context
$code_base Phan\CodeBase
return Phan\Language\Context Analyze the node associated with this object in the given context

appendParameter() public method

public appendParameter ( Parameter $parameter ) : void
$parameter Parameter A parameter to append to the parameter list
return void

getFQSEN() public method

public getFQSEN ( ) : FullyQualifiedMethodName | FullyQualifiedFunctionName
return Phan\Language\FQSEN\FullyQualifiedMethodName | Phan\Language\FQSEN\FullyQualifiedFunctionName The fully-qualified structural element name of this structural element

getHasReturn() public method

public getHasReturn ( ) : boolean
return boolean True if this method returns a value

getInternalScope() public method

public getInternalScope ( ) : Phan\Language\Scope\ClosedScope
return Phan\Language\Scope\ClosedScope The internal scope of this closed scope element

getNumberOfOptionalParameters() public method

public getNumberOfOptionalParameters ( ) : integer
return integer The number of optional parameters on this method

getNumberOfParameters() public method

public getNumberOfParameters ( ) : integer
return integer The maximum number of parameters to this method

getNumberOfRequiredParameters() public method

public getNumberOfRequiredParameters ( ) : integer
return integer The number of required parameters on this method

getParameterForCaller() public method

In the case of variadic arguments, an infinite number of parameters exist. (The callee would see variadic arguments(T ...$args) as a single variable of type T[], while the caller sees a place expecting an expression of type T.
public getParameterForCaller ( integer $i ) : Parameter | null
$i integer - offset of the parameter.
return Parameter | null The parameter type that the **caller** observes.

getParameterList() public method

public getParameterList ( ) : Parameter[]
return Parameter[] A list of parameters on the method

isReturnTypeUndefined() public method

public isReturnTypeUndefined ( ) : boolean
return boolean True if this method had no return type defined when it was defined (either in the signature itself or in the docblock).

setHasReturn() public method

public setHasReturn ( boolean $has_return ) : void
$has_return boolean Set to true to mark this method as having a return value (Only through `return`)
return void

setHasYield() public method

public setHasYield ( boolean $has_return ) : void
$has_return boolean
return void

setInternalScope() public method

public setInternalScope ( Phan\Language\Scope\ClosedScope $internal_scope ) : void
$internal_scope Phan\Language\Scope\ClosedScope
return void

setIsReturnTypeUndefined() public method

public setIsReturnTypeUndefined ( boolean $is_return_type_undefined ) : void
$is_return_type_undefined boolean True if this method had no return type defined when it was defined (either in the signature itself or in the docblock).
return void

setNumberOfOptionalParameters() public method

The number of optional parameters
public setNumberOfOptionalParameters ( integer $number ) : void
$number integer
return void

setNumberOfRequiredParameters() public method

The number of required parameters
public setNumberOfRequiredParameters ( integer $number ) : void
$number integer
return void

setParameterList() public method

public setParameterList ( array $parameter_list ) : void
$parameter_list array A list of parameters to set on this method
return void