PHP Class PDepend\Source\Language\PHP\PHPParserVersion70

TODO: - Tokens: trait, callable, insteadof - allowed as - method - constant - not allowed as - class - interface - trait
Since: 2.3
Inheritance: extends PHPParserVersion56
Datei anzeigen Open project: pdepend/pdepend Class Usage Examples

Protected Methods

Method Description
isMethodName ( integer $tokenType ) : boolean
parseAllocationExpressionTypeReference ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : PDepend\Source\AST\ASTNode Parse the type reference used in an allocation expression.
parseAnonymousClassDeclaration ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : null | ASTAnonymousClass Attempts to the next sequence of tokens as an anonymous class and adds it to the allocation expression
parseCallableDeclarationAddition ( PDepend\Source\AST\AbstractASTCallable $callable ) : PDepend\Source\AST\AbstractASTCallable
parseExpressionVersion70 ( ) : PDepend\Source\AST\ASTNode In this method we implement parsing of PHP 7.0 specific expressions.
parseFormalParameter ( ) : PDepend\Source\AST\ASTFormalParameter This method will parse a formal parameter. A formal parameter is at least a variable name, but can also contain a default parameter value.
parseOptionalExpressionForVersion ( ) : PDepend\Source\AST\ASTNode This method will be called when the base parser cannot handle an expression in the base version. In this method you can implement version specific expressions.
parseReturnTypeHint ( ) : PDepend\Source\AST\ASTType
parseTypeHint ( ) : PDepend\Source\AST\ASTNode Parses a type hint that is valid in the supported PHP version.

Private Methods

Method Description
isScalarOrCallableTypeHint ( string $image ) : boolean Tests if the given image is a PHP 7 type hint.
parseScalarOrCallableTypeHint ( string $image ) : PDepend\Source\AST\ASTType Parses a scalar type hint or a callable type hint.

Method Details

isMethodName() protected method

protected isMethodName ( integer $tokenType ) : boolean
$tokenType integer
return boolean

parseAllocationExpressionTypeReference() protected method

Parse the type reference used in an allocation expression.
Since: 2.3
protected parseAllocationExpressionTypeReference ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : PDepend\Source\AST\ASTNode
$allocation PDepend\Source\AST\ASTAllocationExpression
return PDepend\Source\AST\ASTNode

parseAnonymousClassDeclaration() protected method

Attempts to the next sequence of tokens as an anonymous class and adds it to the allocation expression
protected parseAnonymousClassDeclaration ( PDepend\Source\AST\ASTAllocationExpression $allocation ) : null | ASTAnonymousClass
$allocation PDepend\Source\AST\ASTAllocationExpression
return null | PDepend\Source\AST\ASTAnonymousClass

parseCallableDeclarationAddition() protected method

protected parseCallableDeclarationAddition ( PDepend\Source\AST\AbstractASTCallable $callable ) : PDepend\Source\AST\AbstractASTCallable
$callable PDepend\Source\AST\AbstractASTCallable
return PDepend\Source\AST\AbstractASTCallable

parseExpressionVersion70() protected method

In this method we implement parsing of PHP 7.0 specific expressions.
Since: 2.3
protected parseExpressionVersion70 ( ) : PDepend\Source\AST\ASTNode
return PDepend\Source\AST\ASTNode

parseFormalParameter() protected method

-- ------- function foo(Bar $x, $y = 42) } -- -------
Since: 2.0.7
protected parseFormalParameter ( ) : PDepend\Source\AST\ASTFormalParameter
return PDepend\Source\AST\ASTFormalParameter

parseOptionalExpressionForVersion() protected method

This method will be called when the base parser cannot handle an expression in the base version. In this method you can implement version specific expressions.
Since: 2.3
protected parseOptionalExpressionForVersion ( ) : PDepend\Source\AST\ASTNode
return PDepend\Source\AST\ASTNode

parseReturnTypeHint() protected method

protected parseReturnTypeHint ( ) : PDepend\Source\AST\ASTType
return PDepend\Source\AST\ASTType

parseTypeHint() protected method

Parses a type hint that is valid in the supported PHP version.
Since: 2.3
protected parseTypeHint ( ) : PDepend\Source\AST\ASTNode
return PDepend\Source\AST\ASTNode