Interface ClassTree
-
- All Superinterfaces:
HasAttributes,Tree
- All Known Subinterfaces:
AnonymousClassTree,ClassDeclarationTree
- All Known Implementing Classes:
AnonymousClassTreeImpl,ClassDeclarationTreeImpl
public interface ClassTree extends Tree, HasAttributes
Common interface forClassDeclarationTreeandAnonymousClassTree
-
-
Field Summary
Fields Modifier and Type Field Description static StringPHP5_CONSTRUCTOR_NAMEPHP 5 introduce a new way to declare constructors: by defining a method named "__construct".
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SyntaxTokenclassToken()SyntaxTokencloseCurlyBraceToken()SyntaxTokenextendsToken()MethodDeclarationTreefetchConstructor()Fetch class constructor declaration within classmembers.SyntaxTokenimplementsToken()List<ClassMemberTree>members()SyntaxTokenopenCurlyBraceToken()NamespaceNameTreesuperClass()SeparatedList<NamespaceNameTree>superInterfaces()-
Methods inherited from interface org.sonar.plugins.php.api.tree.declaration.HasAttributes
attributeGroups
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
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 classmembers. 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.
-
-