Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phpparser namespace #1026

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Translation/ColumnTitleAnnotationTranslationExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

class ColumnTitleAnnotationTranslationExtractor implements FileVisitorInterface, \PHPParser_NodeVisitor, ContainerAwareInterface
class ColumnTitleAnnotationTranslationExtractor implements FileVisitorInterface, \PHPParser\NodeVisitor, ContainerAwareInterface
{
private $annotated;
private $catalogue;
Expand All @@ -29,23 +29,23 @@ public function beforeTraverse(array $nodes)
$this->parsedClassName = null;
}

public function enterNode(\PHPParser_Node $node)
public function enterNode(\PHPParser\Node $node)
{
if ($node instanceof \PHPParser_Node_Stmt_Namespace) {
if ($node instanceof \PHPParser\Node\Stmt\Namespace_) {
// Base namespace
$this->parsedClassName = $node->name->toString();
} elseif ($node instanceof \PHPParser_Node_Stmt_UseUse) {
} elseif ($node instanceof \PHPParser\Node\Stmt\UseUse) {
// Don't worry about classes that don't import the grid mapper
if ('APY_DataGridBundle_Grid_Mapping' == $node->name->toString('_')) {
$this->annotated = true;
}
} elseif ($node instanceof \PHPParser_Node_Stmt_Class) {
} elseif ($node instanceof \PHPParser\Node\Stmt\Class_) {
// Append class name to base namespace
$this->parsedClassName .= '\\' . $node->name;
}
}

public function leaveNode(\PHPParser_Node $node)
public function leaveNode(\PHPParser\Node $node)
{
}
public function afterTraverse(array $nodes)
Expand All @@ -61,7 +61,7 @@ public function visitPhpFile(\SplFileInfo $file, MessageCatalogue $catalogue, ar
$this->catalogue = $catalogue;

// Traverse document to assemble class name
$traverser = new \PHPParser_NodeTraverser();
$traverser = new \PHPParser\NodeTraverser();
$traverser->addVisitor($this);
$traverser->traverse($ast);

Expand All @@ -84,7 +84,7 @@ public function visitPhpFile(\SplFileInfo $file, MessageCatalogue $catalogue, ar
}
}

public function visitTwigFile(\SplFileInfo $file, MessageCatalogue $catalogue, \Twig_Node $node)
public function visitTwigFile(\SplFileInfo $file, MessageCatalogue $catalogue, \Twig\Node $node)
{
}

Expand Down