From 9c6758bfc883e00953bd26ca76b2dd9a3e9daf08 Mon Sep 17 00:00:00 2001 From: freek Date: Mon, 28 Mar 2016 12:21:38 +0200 Subject: [PATCH] add doc blocks --- src/NodeVisitors/AnonymousClassReplacer.php | 1 - src/NodeVisitors/DefineArrayReplacer.php | 14 ++++++++------ src/NodeVisitors/GroupUseReplacer.php | 5 ++++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/NodeVisitors/AnonymousClassReplacer.php b/src/NodeVisitors/AnonymousClassReplacer.php index 83abc2a..7230210 100644 --- a/src/NodeVisitors/AnonymousClassReplacer.php +++ b/src/NodeVisitors/AnonymousClassReplacer.php @@ -84,7 +84,6 @@ protected function getAnonymousClassHookIndex(array $statements) if (!$statement instanceof Declare_ && !$statement instanceof Use_ && !$statement instanceof Namespace_) { - $hookIndex = $index; } } diff --git a/src/NodeVisitors/DefineArrayReplacer.php b/src/NodeVisitors/DefineArrayReplacer.php index abbf244..1f392ad 100644 --- a/src/NodeVisitors/DefineArrayReplacer.php +++ b/src/NodeVisitors/DefineArrayReplacer.php @@ -11,26 +11,28 @@ class DefineArrayReplacer extends NodeVisitorAbstract { + /** + * {@inheritdoc} + */ public function leaveNode(Node $node) { if (!$node instanceof Node\Expr\FuncCall) { - return null; + return; } if ($node->name != 'define') { - return null; + return; } $nameNode = $node->args[0]->value; $valueNode = $node->args[1]->value; - if (! $valueNode instanceof Node\Expr\Array_) { - return null; + if (!$valueNode instanceof Node\Expr\Array_) { + return; } $constNode = new Node\Const_($nameNode->value, $valueNode); return new Node\Stmt\Const_([$constNode]); } - -} \ No newline at end of file +} diff --git a/src/NodeVisitors/GroupUseReplacer.php b/src/NodeVisitors/GroupUseReplacer.php index 5ed6f82..070fbb5 100644 --- a/src/NodeVisitors/GroupUseReplacer.php +++ b/src/NodeVisitors/GroupUseReplacer.php @@ -7,6 +7,9 @@ class GroupUseReplacer extends NodeVisitorAbstract { + /** + * {@inheritdoc} + */ public function leaveNode(Node $node) { if (!$node instanceof Node\Stmt\GroupUse) { @@ -34,4 +37,4 @@ protected function createUseNode(array $nodePrefixParts, Node $useNode) return $useNode; } -} \ No newline at end of file +}