PHP Class Zephir\ClassMethod

Represents a class method
Afficher le fichier Open project: phalcon/zephir Class Usage Examples

Méthodes publiques

Свойство Type Description
$optimizable

Protected Properties

Свойство Type Description
$callGathererPass Zephir\Passes\CallGathererPass Call Gatherer Pass
$classDefinition ClassDefinition
$docblock string
$expression array | null
$isAbstract boolean Whether the method is abstract or not
$isBundled boolean Whether the method is bundled with PHP or not
$isFinal boolean Whether the method is final or not
$isInitializer boolean Whether the method is an initializer or not
$isInternal boolean Whether the method is internal or not
$isPublic boolean Whether the method is public or not
$isStatic boolean Whether the method is static or not
$localContext Zephir\Passes\LocalContextPass LocalContextPass
$name string
$parameters ClassMethodParameters
$parsedDocblock Zephir\Documentation\Docblock
$returnClassTypes Class type hints returned by the method
$returnTypes array Types returned by the method
$returnTypesRaw array Raw-types returned by the method
$statements
$typeInference Zephir\Passes\StaticTypeInference Static Type Inference Pass
$visibility array
$void boolean Whether the variable is void

Méthodes publiques

Méthode Description
__construct ( ClassDefinition $classDefinition, array $visibility, $name, $parameters, zephir\StatementsBlock $statements = null, null $docblock = null, null $returnType = null, array $original = null ) ClassMethod constructor
areReturnTypesBoolCompatible ( string $type = null ) : boolean Checks whether at least one return type hint is integer compatible
areReturnTypesDoubleCompatible ( string $type = null ) : boolean Checks whether at least one return type hint is double compatible
areReturnTypesIntCompatible ( string $type = null ) : boolean Checks whether at least one return type hint is integer compatible
areReturnTypesNullCompatible ( string $type = null ) : boolean Checks whether at least one return type hint is null compatible
areReturnTypesStringCompatible ( string $type = null ) : boolean Checks whether at least one return type hint is integer compatible
assignDefaultValue ( array $parameter, zephir\CompilationContext $compilationContext ) : string Assigns a default value
assignZvalValue ( array $parameter, zephir\CompilationContext $compilationContext ) : string Assigns a zval value to a static low-level type
checkStrictType ( array $parameter, zephir\CompilationContext $compilationContext ) : string Assigns a zval value to a static low-level type
checkVisibility ( array $visibility, string $name, array $original = null ) Checks for visibility congruence
compile ( zephir\CompilationContext $compilationContext ) : null Compiles the method
getCallGathererPass ( ) : Zephir\Passes\CallGathererPass Returns the call gatherer pass information
getClassDefinition ( ) : ClassDefinition Returns the class definition where the method was declared
getDocBlock ( ) : string Returns the raw docblock
getInternalName ( ) : string
getInternalParameters ( ) : string Returns the number of required parameters the method has
getLastLine ( ) : mixed the ending line of the method in the source file
getLine ( ) : mixed the starting line of the method in the source file
getLocalContextPass ( ) : LocalContextPass Returns the local context pass information
getModifiers ( ) : string Returns the C-modifier flags
getName ( ) : string Returns the method name
getNumberOfParameters ( ) : integer Returns the number of parameters the method has
getNumberOfRequiredParameters ( ) : integer Returns the number of required parameters the method has
getOptimizedMethod ( )
getParameters ( ) : ClassMethodParameters Returns the parameters
getParsedDocBlock ( ) : Docblock Returns the parsed docblock
getReturnClassTypes ( ) : array Returned class-type hints by the method
getReturnTypes ( ) : array Returned type hints by the method
getReturnTypesRaw ( ) : array
getShortcutName ( ) : mixed Return shortcut method name
getStatementsBlock ( ) : zephir\StatementsBlock Getter for statements block
getStaticTypeInferencePass ( ) : Zephir\Passes\StaticTypeInference Returns the static type inference pass information
getVisibility ( ) : array Returns method visibility modifiers
hasChildReturnStatementType ( array $statement ) : boolean Simple method to check if one of the paths are returning the right expected type
hasModifier ( string $modifier ) : boolean Checks whether the method has a specific modifier
hasParameters ( ) : boolean Returns the number of parameters the method has
hasReturnTypes ( ) : boolean Checks if the method has return-type or cast hints
hasReturnTypesRaw ( )
isAbstract ( ) : boolean Checks is abstract method?
isBundled ( ) : boolean Checks whether the method is bundled
isConstructor ( ) : boolean Check whether the current method is a constructor
isDeprecated ( )
isEmpty ( ) : boolean Checks whether the method is empty
isFinal ( ) : boolean Checks whether the method is final
isInitializer ( ) : boolean Checks whether the method is an initializer
isInline ( ) : boolean Checks if the method is inline
isInternal ( ) : boolean Checks whether the method is internal
isPrivate ( ) : boolean Checks if the method is private
isProtected ( ) : boolean Checks if the method is protected
isPublic ( ) : boolean Checks if the method is public
isShortcut ( ) : boolean Checks if method is a shortcut
isStatic ( ) : boolean Checks whether the method is static
isVoid ( ) : boolean Checks if the method must not return any value
preCompile ( zephir\CompilationContext $compilationContext ) : null Pre-compiles the method making compilation pass data (static inference, local-context-pass) available to other methods
removeMemoryStackReferences ( SymbolTable $symbolTable, string $containerCode ) : mixed Replace macros
setIsBundled ( boolean $bundled ) Sets if the method is bundled or not
setIsInitializer ( boolean $initializer ) Sets if the method is an initializer or not
setIsInternal ( boolean $internal ) Sets if the method is internal or not
setIsStatic ( boolean $static ) Sets if the method is internal or not
setName ( string $name ) Sets the method name
setReturnTypes ( $returnType )
setStatementsBlock ( zephir\StatementsBlock $statementsBlock ) Setter for statements block
setupOptimized ( zephir\CompilationContext $compilationContext ) Generate internal method's based on the equivalent PHP methods, allowing bypassing php userspace for internal method calls

Method Details

__construct() public méthode

ClassMethod constructor
public __construct ( ClassDefinition $classDefinition, array $visibility, $name, $parameters, zephir\StatementsBlock $statements = null, null $docblock = null, null $returnType = null, array $original = null )
$classDefinition ClassDefinition
$visibility array
$name
$parameters
$statements zephir\StatementsBlock
$docblock null
$returnType null
$original array

areReturnTypesBoolCompatible() public méthode

Checks whether at least one return type hint is integer compatible
public areReturnTypesBoolCompatible ( string $type = null ) : boolean
$type string
Résultat boolean

areReturnTypesDoubleCompatible() public méthode

Checks whether at least one return type hint is double compatible
public areReturnTypesDoubleCompatible ( string $type = null ) : boolean
$type string
Résultat boolean

areReturnTypesIntCompatible() public méthode

Checks whether at least one return type hint is integer compatible
public areReturnTypesIntCompatible ( string $type = null ) : boolean
$type string
Résultat boolean

areReturnTypesNullCompatible() public méthode

Checks whether at least one return type hint is null compatible
public areReturnTypesNullCompatible ( string $type = null ) : boolean
$type string
Résultat boolean

areReturnTypesStringCompatible() public méthode

Checks whether at least one return type hint is integer compatible
public areReturnTypesStringCompatible ( string $type = null ) : boolean
$type string
Résultat boolean

assignDefaultValue() public méthode

Assigns a default value
public assignDefaultValue ( array $parameter, zephir\CompilationContext $compilationContext ) : string
$parameter array
$compilationContext zephir\CompilationContext
Résultat string

assignZvalValue() public méthode

Assigns a zval value to a static low-level type
public assignZvalValue ( array $parameter, zephir\CompilationContext $compilationContext ) : string
$parameter array
$compilationContext zephir\CompilationContext
Résultat string

checkStrictType() public méthode

Assigns a zval value to a static low-level type
public checkStrictType ( array $parameter, zephir\CompilationContext $compilationContext ) : string
$parameter array
$compilationContext zephir\CompilationContext
Résultat string

checkVisibility() public méthode

Checks for visibility congruence
public checkVisibility ( array $visibility, string $name, array $original = null )
$visibility array
$name string
$original array

compile() public méthode

Compiles the method
public compile ( zephir\CompilationContext $compilationContext ) : null
$compilationContext zephir\CompilationContext
Résultat null

getCallGathererPass() public méthode

Returns the call gatherer pass information
public getCallGathererPass ( ) : Zephir\Passes\CallGathererPass
Résultat Zephir\Passes\CallGathererPass

getClassDefinition() public méthode

Returns the class definition where the method was declared
public getClassDefinition ( ) : ClassDefinition
Résultat ClassDefinition

getDocBlock() public méthode

Returns the raw docblock
public getDocBlock ( ) : string
Résultat string

getInternalName() public méthode

public getInternalName ( ) : string
Résultat string

getInternalParameters() public méthode

Returns the number of required parameters the method has
public getInternalParameters ( ) : string
Résultat string

getLastLine() public méthode

the ending line of the method in the source file
public getLastLine ( ) : mixed
Résultat mixed

getLine() public méthode

the starting line of the method in the source file
public getLine ( ) : mixed
Résultat mixed

getLocalContextPass() public méthode

Returns the local context pass information
public getLocalContextPass ( ) : LocalContextPass
Résultat Zephir\Passes\LocalContextPass

getModifiers() public méthode

Returns the C-modifier flags
public getModifiers ( ) : string
Résultat string

getName() public méthode

Returns the method name
public getName ( ) : string
Résultat string

getNumberOfParameters() public méthode

Returns the number of parameters the method has
public getNumberOfParameters ( ) : integer
Résultat integer

getNumberOfRequiredParameters() public méthode

Returns the number of required parameters the method has

getOptimizedMethod() public méthode

public getOptimizedMethod ( )

getParameters() public méthode

Returns the parameters
public getParameters ( ) : ClassMethodParameters
Résultat ClassMethodParameters

getParsedDocBlock() public méthode

Returns the parsed docblock
public getParsedDocBlock ( ) : Docblock
Résultat Zephir\Documentation\Docblock

getReturnClassTypes() public méthode

Returned class-type hints by the method
public getReturnClassTypes ( ) : array
Résultat array

getReturnTypes() public méthode

Returned type hints by the method
public getReturnTypes ( ) : array
Résultat array

getReturnTypesRaw() public méthode

public getReturnTypesRaw ( ) : array
Résultat array

getShortcutName() public méthode

Return shortcut method name
public getShortcutName ( ) : mixed
Résultat mixed

getStatementsBlock() public méthode

Getter for statements block
public getStatementsBlock ( ) : zephir\StatementsBlock
Résultat zephir\StatementsBlock $statements Statements block

getStaticTypeInferencePass() public méthode

Returns the static type inference pass information
public getStaticTypeInferencePass ( ) : Zephir\Passes\StaticTypeInference
Résultat Zephir\Passes\StaticTypeInference

getVisibility() public méthode

Returns method visibility modifiers
public getVisibility ( ) : array
Résultat array

hasChildReturnStatementType() public méthode

Simple method to check if one of the paths are returning the right expected type
public hasChildReturnStatementType ( array $statement ) : boolean
$statement array
Résultat boolean

hasModifier() public méthode

Checks whether the method has a specific modifier
public hasModifier ( string $modifier ) : boolean
$modifier string
Résultat boolean

hasParameters() public méthode

Returns the number of parameters the method has
public hasParameters ( ) : boolean
Résultat boolean

hasReturnTypes() public méthode

Checks if the method has return-type or cast hints
public hasReturnTypes ( ) : boolean
Résultat boolean

hasReturnTypesRaw() public méthode

public hasReturnTypesRaw ( )

isAbstract() public méthode

Checks is abstract method?
public isAbstract ( ) : boolean
Résultat boolean

isBundled() public méthode

Checks whether the method is bundled
public isBundled ( ) : boolean
Résultat boolean

isConstructor() public méthode

Check whether the current method is a constructor
public isConstructor ( ) : boolean
Résultat boolean

isDeprecated() public méthode

public isDeprecated ( )

isEmpty() public méthode

Checks whether the method is empty
public isEmpty ( ) : boolean
Résultat boolean

isFinal() public méthode

Checks whether the method is final
public isFinal ( ) : boolean
Résultat boolean

isInitializer() public méthode

Checks whether the method is an initializer
public isInitializer ( ) : boolean
Résultat boolean

isInline() public méthode

Checks if the method is inline
public isInline ( ) : boolean
Résultat boolean

isInternal() public méthode

Checks whether the method is internal
public isInternal ( ) : boolean
Résultat boolean

isPrivate() public méthode

Checks if the method is private
public isPrivate ( ) : boolean
Résultat boolean

isProtected() public méthode

Checks if the method is protected
public isProtected ( ) : boolean
Résultat boolean

isPublic() public méthode

Checks if the method is public
public isPublic ( ) : boolean
Résultat boolean

isShortcut() public méthode

Checks if method is a shortcut
public isShortcut ( ) : boolean
Résultat boolean

isStatic() public méthode

Checks whether the method is static
public isStatic ( ) : boolean
Résultat boolean

isVoid() public méthode

Checks if the method must not return any value
public isVoid ( ) : boolean
Résultat boolean

preCompile() public méthode

Pre-compiles the method making compilation pass data (static inference, local-context-pass) available to other methods
public preCompile ( zephir\CompilationContext $compilationContext ) : null
$compilationContext zephir\CompilationContext
Résultat null

removeMemoryStackReferences() public méthode

Replace macros
public removeMemoryStackReferences ( SymbolTable $symbolTable, string $containerCode ) : mixed
$symbolTable SymbolTable
$containerCode string
Résultat mixed

setIsBundled() public méthode

Sets if the method is bundled or not
public setIsBundled ( boolean $bundled )
$bundled boolean

setIsInitializer() public méthode

Sets if the method is an initializer or not
public setIsInitializer ( boolean $initializer )
$initializer boolean

setIsInternal() public méthode

Sets if the method is internal or not
public setIsInternal ( boolean $internal )
$internal boolean

setIsStatic() public méthode

Sets if the method is internal or not
public setIsStatic ( boolean $static )
$static boolean

setName() public méthode

Sets the method name
public setName ( string $name )
$name string

setReturnTypes() public méthode

public setReturnTypes ( $returnType )

setStatementsBlock() public méthode

Setter for statements block
public setStatementsBlock ( zephir\StatementsBlock $statementsBlock )
$statementsBlock zephir\StatementsBlock

setupOptimized() public méthode

Generate internal method's based on the equivalent PHP methods, allowing bypassing php userspace for internal method calls
public setupOptimized ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

Property Details

$callGathererPass protected_oe property

Call Gatherer Pass
protected CallGathererPass,Zephir\Passes $callGathererPass
Résultat Zephir\Passes\CallGathererPass

$classDefinition protected_oe property

protected ClassDefinition,zephir $classDefinition
Résultat ClassDefinition

$docblock protected_oe property

protected string $docblock
Résultat string

$expression protected_oe property

protected array|null $expression
Résultat array | null

$isAbstract protected_oe property

Whether the method is abstract or not
protected bool $isAbstract
Résultat boolean

$isBundled protected_oe property

Whether the method is bundled with PHP or not
protected bool $isBundled
Résultat boolean

$isFinal protected_oe property

Whether the method is final or not
protected bool $isFinal
Résultat boolean

$isInitializer protected_oe property

Whether the method is an initializer or not
protected bool $isInitializer
Résultat boolean

$isInternal protected_oe property

Whether the method is internal or not
protected bool $isInternal
Résultat boolean

$isPublic protected_oe property

Whether the method is public or not
protected bool $isPublic
Résultat boolean

$isStatic protected_oe property

Whether the method is static or not
protected bool $isStatic
Résultat boolean

$localContext protected_oe property

LocalContextPass
protected LocalContextPass,Zephir\Passes $localContext
Résultat Zephir\Passes\LocalContextPass

$name protected_oe property

protected string $name
Résultat string

$optimizable public_oe property

public $optimizable

$parameters protected_oe property

protected ClassMethodParameters,zephir $parameters
Résultat ClassMethodParameters

$parsedDocblock protected_oe property

protected Docblock,Zephir\Documentation $parsedDocblock
Résultat Zephir\Documentation\Docblock

$returnClassTypes protected_oe property

Class type hints returned by the method
protected $returnClassTypes

$returnTypes protected_oe property

Types returned by the method
protected array $returnTypes
Résultat array

$returnTypesRaw protected_oe property

Raw-types returned by the method
protected array $returnTypesRaw
Résultat array

$statements protected_oe property

protected $statements

$typeInference protected_oe property

Static Type Inference Pass
protected StaticTypeInference,Zephir\Passes $typeInference
Résultat Zephir\Passes\StaticTypeInference

$visibility protected_oe property

protected array $visibility
Résultat array

$void protected_oe property

Whether the variable is void
protected bool $void
Résultat boolean