Documentation ¶
Index ¶
- func ExprType(sc *meta.Scope, cs *meta.ClassParseState, n node.Node) meta.TypesMap
- func ExprTypeCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap
- func ExprTypeLocal(sc *meta.Scope, cs *meta.ClassParseState, n node.Node) meta.TypesMap
- func ExprTypeLocalCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap
- func FindConstant(className string, constName string) (res meta.ConstantInfo, implClassName string, ok bool)
- func GetClassName(cs *meta.ClassParseState, classNode node.Node) (className string, ok bool)
- func GetConstant(cs *meta.ClassParseState, constNode node.Node) (constName string, ci meta.ConstantInfo, ok bool)
- func Implements(className string, interfaceName string) bool
- func NodeAwareDeepEqual(a, b interface{}) bool
- func ResolveTypes(curStaticClass string, m meta.TypesMap, visitedMap map[string]struct{}) map[string]struct{}
- type CustomType
- type FindMethodResult
- type FindPropertyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExprType ¶
ExprType returns type of expression. Depending on whether or not is it "full mode", it will also recursively resolve all nested types
func ExprTypeCustom ¶
func ExprTypeCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap
ExprTypeCustom is ExprType that allows to specify custom types overrides
func ExprTypeLocal ¶
ExprTypeLocal is basic expression type that does not resolve cross-file function calls and such
func ExprTypeLocalCustom ¶
func ExprTypeLocalCustom(sc *meta.Scope, cs *meta.ClassParseState, n node.Node, custom []CustomType) meta.TypesMap
ExprTypeLocalCustom is ExprTypeLocal that allows to specify custom types
func FindConstant ¶
func FindConstant(className string, constName string) (res meta.ConstantInfo, implClassName string, ok bool)
FindConstant searches for a costant in specified class and returns actual class that contains the constant.
func GetClassName ¶
GetClassName resolves class name for specified class node (as used in static calls, property fetch, etc)
func GetConstant ¶
func GetConstant(cs *meta.ClassParseState, constNode node.Node) (constName string, ci meta.ConstantInfo, ok bool)
GetConstant searches for specified constant in const fetch.
func Implements ¶
Implements checks if className implements interfaceName
Does not perform the actual method set comparison.
func NodeAwareDeepEqual ¶ added in v0.2.0
func NodeAwareDeepEqual(a, b interface{}) bool
NodeAwareDeepEqual is a reflect.DeepEqual but knows how to compare node.Node by ignoring freefloating text and positions
Types ¶
type CustomType ¶
CustomType specifies a mapping between some AST structure and concrete type (e.g. for <expr> instanceof <something>)
type FindMethodResult ¶ added in v0.2.0
type FindMethodResult struct { Info meta.FuncInfo ClassName string TraitName string Implemented bool }
func FindMethod ¶
func FindMethod(className string, methodName string) (FindMethodResult, bool)
FindMethod searches for a method in specified class
func (FindMethodResult) ImplName ¶ added in v0.2.0
func (m FindMethodResult) ImplName() string
type FindPropertyResult ¶ added in v0.2.0
type FindPropertyResult struct { Info meta.PropertyInfo ClassName string TraitName string }
func FindProperty ¶
func FindProperty(className string, propertyName string) (FindPropertyResult, bool)
FindProperty searches for a property in specified class (both static and instance properties)
func (FindPropertyResult) ImplName ¶ added in v0.2.0
func (p FindPropertyResult) ImplName() string