Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

More marker interfaces, wrapped name nodes

Compare
Choose a tag to compare
@fredemmott fredemmott released this 13 May 18:39

This release adds many more 'marker' interfaces to quickly identify and work with various kinds of nodes via type tests; the complete list is now:

  • IClassBody
  • IComment
  • IContainer
  • IControlFlowStatement
  • IExpression
  • IFunctionCallishExpression
  • IFunctionishDeclaration
  • IHackArray
  • IHasAttributeSpec
  • IHasFunctionBody
  • IHasOperator
  • IHasTypeHint
  • ILambdaBody
  • ILambdaSignature
  • ILoopStatement
  • INameishNode
  • INamespaceBody
  • INamespaceUseDeclaration
  • IPHPArray
  • IParameter
  • ISimpleCreationSpecifier
  • IStatement
  • IStringLiteral
  • ISwitchLabel
  • ITraitUseItem
  • ITypeSpecifier
  • IXHPAttribute

There is one caveat: NameToken and QualifiedName can sometimes be expressions - when they represent a constant name - but sometimes aren't - for example, when they're representing a class name, such as in an instanceof or is expression. In cases where a field is an IExpression, a wrapper node is created - NameExpression. The underlying NameToken or QualifiedName can be retrieved with getWrappedNode(). This allows targetting IExpression without incorrectly acting on all name tokens and qualified names.

This release supports HHVM 4.3 and above.