Skip to content

Commit

Permalink
Housekeeping: Be more explicite
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Pichler committed Jan 19, 2017
1 parent 73db082 commit 61b6da5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/main/php/PDepend/Source/Language/PHP/AbstractPHPParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,21 +840,21 @@ protected function parseInterfaceList(AbstractASTClassOrInterface $abstractType)
/**
* Parses a class/interface/trait body.
*
* @param \PDepend\Source\AST\AbstractASTType $type
* @return \PDepend\Source\AST\AbstractASTType
* @param \PDepend\Source\AST\AbstractASTClassOrInterface $classOrInterface
* @return \PDepend\Source\AST\AbstractASTClassOrInterface
* @throws \PDepend\Source\Parser\UnexpectedTokenException
* @throws \PDepend\Source\Parser\TokenStreamEndException
*/
protected function parseTypeBody(AbstractASTType $type)
protected function parseTypeBody(AbstractASTClassOrInterface $classOrInterface)
{
$this->classOrInterface = $type;
$this->classOrInterface = $classOrInterface;

// Consume comments and read opening curly brace
$this->consumeComments();
$this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);

$defaultModifier = State::IS_PUBLIC;
if ($type instanceof ASTInterface) {
if ($classOrInterface instanceof ASTInterface) {
$defaultModifier |= State::IS_ABSTRACT;
}
$this->reset();
Expand All @@ -877,13 +877,13 @@ protected function parseTypeBody(AbstractASTType $type)
);

if ($methodOrProperty instanceof \PDepend\Source\AST\ASTNode) {
$type->addChild($methodOrProperty);
$classOrInterface->addChild($methodOrProperty);
}

$this->reset();
break;
case Tokens::T_CONST:
$type->addChild($this->parseConstantDefinition());
$classOrInterface->addChild($this->parseConstantDefinition());
$this->reset();
break;
case Tokens::T_CURLY_BRACE_CLOSE:
Expand All @@ -895,7 +895,7 @@ protected function parseTypeBody(AbstractASTType $type)
$this->classOrInterface = null;

// Stop processing
return $type;
return $classOrInterface;
case Tokens::T_COMMENT:
$token = $this->consumeToken(Tokens::T_COMMENT);

Expand All @@ -907,7 +907,7 @@ protected function parseTypeBody(AbstractASTType $type)
$token->endColumn
);

$type->addChild($comment);
$classOrInterface->addChild($comment);
break;
case Tokens::T_DOC_COMMENT:
$token = $this->consumeToken(Tokens::T_DOC_COMMENT);
Expand All @@ -920,12 +920,12 @@ protected function parseTypeBody(AbstractASTType $type)
$token->endColumn
);

$type->addChild($comment);
$classOrInterface->addChild($comment);

$this->docComment = $token->image;
break;
case Tokens::T_USE:
$type->addChild($this->parseTraitUseStatement());
$classOrInterface->addChild($this->parseTraitUseStatement());
break;
default:
$this->throwUnexpectedTokenException();
Expand Down

0 comments on commit 61b6da5

Please sign in to comment.