Skip to content

Commit

Permalink
Closes #276, a caching regression introduced in 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Pichler committed Nov 23, 2016
1 parent 132c0a5 commit 48d8081
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Expand Up @@ -1950,12 +1950,12 @@ protected function isNextTokenArguments()
/**
* This method configures the given node with its start and end positions.
*
* @param \PDepend\Source\AST\ASTNode $node The node to prepare.
*
* @param \PDepend\Source\AST\ASTNode $node
* @param array &$tokens
* @return \PDepend\Source\AST\ASTNode
* @since 0.9.8
*/
protected function setNodePositionsAndReturn(ASTNode $node)
protected function setNodePositionsAndReturn(ASTNode $node, array &$tokens = null)
{
$tokens = $this->stripTrailingComments($this->tokenStack->pop());

Expand Down
4 changes: 3 additions & 1 deletion src/main/php/PDepend/Source/Language/PHP/PHPBuilder.php
Expand Up @@ -364,7 +364,9 @@ public function getClass($qualifiedName)
*/
public function buildAnonymousClass()
{
return $this->buildAstNodeInstance('ASTAnonymousClass');
return $this->buildAstNodeInstance('ASTAnonymousClass')
->setCache($this->cache)
->setContext($this->context);
}

/**
Expand Down
Expand Up @@ -241,9 +241,11 @@ protected function parseAnonymousClassDeclaration(ASTAllocationExpression $alloc

$allocation->addChild(
$this->setNodePositionsAndReturn(
$this->parseTypeBody($class)
$this->parseTypeBody($class),
$tokens
)
);
$class->setTokens($tokens);

return $allocation;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/PDepend/Util/Cache/CacheDriver.php
Expand Up @@ -55,7 +55,7 @@ interface CacheDriver
/**
* The current cache version.
*/
const VERSION = '@version:cb1970fd585172c5e1b260a6784607df:@';
const VERSION = '@version:29e0576ca411665f3c8d7e29920251da:@';

/**
* Sets the type for the next <em>store()</em> or <em>restore()</em> method
Expand Down

0 comments on commit 48d8081

Please sign in to comment.