Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
add doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Mar 28, 2016
1 parent a61c93c commit 9c6758b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/NodeVisitors/AnonymousClassReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected function getAnonymousClassHookIndex(array $statements)
if (!$statement instanceof Declare_ &&
!$statement instanceof Use_ &&
!$statement instanceof Namespace_) {

$hookIndex = $index;
}
}
Expand Down
14 changes: 8 additions & 6 deletions src/NodeVisitors/DefineArrayReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

}
}
5 changes: 4 additions & 1 deletion src/NodeVisitors/GroupUseReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class GroupUseReplacer extends NodeVisitorAbstract
{
/**
* {@inheritdoc}
*/
public function leaveNode(Node $node)
{
if (!$node instanceof Node\Stmt\GroupUse) {
Expand Down Expand Up @@ -34,4 +37,4 @@ protected function createUseNode(array $nodePrefixParts, Node $useNode)

return $useNode;
}
}
}

0 comments on commit 9c6758b

Please sign in to comment.