Interface ClassTree

All Superinterfaces:
HasAttributes, Tree
All Known Subinterfaces:
AnonymousClassTree, ClassDeclarationTree, EnumDeclarationTree
All Known Implementing Classes:
AnonymousClassTreeImpl, ClassDeclarationTreeImpl, EnumDeclarationTreeImpl

public interface ClassTree extends Tree, HasAttributes
Common interface for ClassDeclarationTree and AnonymousClassTree
  • Field Details

    • PHP5_CONSTRUCTOR_NAME

      static final String PHP5_CONSTRUCTOR_NAME
      PHP 5 introduce a new way to declare constructors: by defining a method named "__construct". Previously constructors were declared by defining a method with the same name as the class.
      See Also:
  • Method Details

    • classToken

      SyntaxToken classToken()
    • extendsToken

      @Nullable SyntaxToken extendsToken()
    • superClass

      @Nullable NamespaceNameTree superClass()
    • implementsToken

      @Nullable SyntaxToken implementsToken()
    • superInterfaces

      SeparatedList<NamespaceNameTree> superInterfaces()
    • openCurlyBraceToken

      SyntaxToken openCurlyBraceToken()
    • members

      List<ClassMemberTree> members()
    • closeCurlyBraceToken

      SyntaxToken closeCurlyBraceToken()
    • fetchConstructor

      @Nullable MethodDeclarationTree fetchConstructor()
      Fetch class constructor declaration within class members. Will look for a method named "__construct", if cannot be found it will search for the old-style constructor function, by the name of the class.
      Returns:
      the class constructor method declaration if defined, null otherwise.