CallableTrait
Tags
Table of Contents
Properties
- $is_pure : bool|null
- $params : array<int, FunctionLikeParameter>|null
- $return_type : Union|null
Methods
- __construct() : mixed
- Constructs a new instance of a generic type
- getId() : string
- getKey() : string
- getParamString() : string
- getReturnTypeString() : string
- replace() : static
- setIsPure() : static
- toNamespacedString() : string
- toPhpString() : string
- getCallableChildNodeKeys() : array<int, string>
- replaceCallableTemplateTypesWithArgTypes() : Union|null}|null
- replaceCallableTemplateTypesWithStandins() : Union|null}|null
Properties
$is_pure
public
bool|null
$is_pure
= null
$params
public
array<int, FunctionLikeParameter>|null
$params
= []
$return_type
public
Union|null
$return_type
= null
Methods
__construct()
Constructs a new instance of a generic type
public
__construct([string $value = 'callable' ][, array<int, FunctionLikeParameter> $params = null ][, Union|null $return_type = null ][, bool|null $is_pure = null ][, bool $from_docblock = false ]) : mixed
Parameters
- $value : string = 'callable'
- $params : array<int, FunctionLikeParameter> = null
- $return_type : Union|null = null
- $is_pure : bool|null = null
- $from_docblock : bool = false
getId()
public
getId([bool $exact = true ][, bool $nested = false ]) : string
Parameters
- $exact : bool = true
- $nested : bool = false
Return values
stringgetKey()
public
getKey([bool $include_extra = true ]) : string
Parameters
- $include_extra : bool = true
Return values
stringgetParamString()
public
getParamString() : string
Return values
stringgetReturnTypeString()
public
getReturnTypeString() : string
Return values
stringreplace()
public
replace(array<int, FunctionLikeParameter>|null $params, Union|null $return_type) : static
Parameters
- $params : array<int, FunctionLikeParameter>|null
- $return_type : Union|null
Return values
staticsetIsPure()
public
setIsPure(bool $is_pure) : static
Parameters
- $is_pure : bool
Return values
statictoNamespacedString()
public
toNamespacedString(string|null $namespace, array<lowercase-string, string> $aliased_classes, string|null $this_class, bool $use_phpdoc_format) : string
Parameters
- $namespace : string|null
- $aliased_classes : array<lowercase-string, string>
- $this_class : string|null
- $use_phpdoc_format : bool
Return values
stringtoPhpString()
public
toPhpString(string|null $namespace, array<lowercase-string, string> $aliased_classes, string|null $this_class, int $analysis_php_version_id) : string
Parameters
- $namespace : string|null
- $aliased_classes : array<lowercase-string, string>
- $this_class : string|null
- $analysis_php_version_id : int
Return values
stringgetCallableChildNodeKeys()
protected
getCallableChildNodeKeys() : array<int, string>
Return values
array<int, string>replaceCallableTemplateTypesWithArgTypes()
protected
replaceCallableTemplateTypesWithArgTypes(TemplateResult $template_result, Codebase|null $codebase) : Union|null}|null
Parameters
- $template_result : TemplateResult
- $codebase : Codebase|null
Return values
Union|null}|nullreplaceCallableTemplateTypesWithStandins()
protected
replaceCallableTemplateTypesWithStandins(TemplateResult $template_result, Codebase $codebase[, StatementsAnalyzer|null $statements_analyzer = null ][, Atomic|null $input_type = null ][, int|null $input_arg_offset = null ][, string|null $calling_class = null ][, string|null $calling_function = null ][, bool $replace = true ][, bool $add_lower_bound = false ][, int $depth = 0 ]) : Union|null}|null
Parameters
- $template_result : TemplateResult
- $codebase : Codebase
- $statements_analyzer : StatementsAnalyzer|null = null
- $input_type : Atomic|null = null
- $input_arg_offset : int|null = null
- $calling_class : string|null = null
- $calling_function : string|null = null
- $replace : bool = true
- $add_lower_bound : bool = false
- $depth : int = 0