Documentation

TypeContextFactory
in package

FinalYes

Creates a type resolving context.

Tags
author

Mathias Arlaud mathias.arlaud@gmail.com

author

Baptiste Leduc baptiste.leduc@gmail.com

author

Pierre-Yves Landuré landure@gmail.com

Table of Contents

Properties

$extraTypeAliases  : array<string|int, mixed>
$intermediateTypeContextCache  : array<string, array<string, TypeContext>>
$phpstanLexer  : Lexer|null
$phpstanParser  : PhpDocParser|null
$reflectionClassCache  : array<class-string, ReflectionClass>
$stringTypeResolver  : StringTypeResolver|null
$typeContextCache  : array<string, array<string, TypeContext>>

Methods

__construct()  : mixed
createFromClassName()  : TypeContext
createFromReflection()  : TypeContext|null
collectTemplates()  : array<string, Type>
collectTypeAliases()  : array<string, Type>
collectUses()  : array<string, string>
createIntermediateTypeContext()  : TypeContext
createNewInstanceFromClassName()  : TypeContext
getPhpDocNode()  : PhpDocNode
resolveTypeAliases()  : array<string, Type>

Properties

$extraTypeAliases read-only

private array<string|int, mixed> $extraTypeAliases = []

$reflectionClassCache

private static array<class-string, ReflectionClass> $reflectionClassCache = []

Methods

createFromClassName()

public createFromClassName(string $calledClassName[, string|null $declaringClassName = null ]) : TypeContext
Parameters
$calledClassName : string
$declaringClassName : string|null = null
Return values
TypeContext

collectTemplates()

private collectTemplates(ReflectionClass|ReflectionFunctionAbstract $reflection, TypeContext $typeContext) : array<string, Type>
Parameters
$reflection : ReflectionClass|ReflectionFunctionAbstract
$typeContext : TypeContext
Return values
array<string, Type>

collectUses()

private collectUses(ReflectionClass $reflection) : array<string, string>
Parameters
$reflection : ReflectionClass
Return values
array<string, string>

createIntermediateTypeContext()

private createIntermediateTypeContext(string $calledClassShortName, ReflectionClass $declaringClassReflection) : TypeContext
Parameters
$calledClassShortName : string
$declaringClassReflection : ReflectionClass
Return values
TypeContext

createNewInstanceFromClassName()

private createNewInstanceFromClassName(string $calledClassName, string $declaringClassName) : TypeContext
Parameters
$calledClassName : string
$declaringClassName : string
Return values
TypeContext

resolveTypeAliases()

private resolveTypeAliases(array<string, string> $toResolve, array<string, Type$resolved, TypeContext $typeContext) : array<string, Type>
Parameters
$toResolve : array<string, string>
$resolved : array<string, Type>
$typeContext : TypeContext
Return values
array<string, Type>

        
On this page

Search results