Skip to content

Commit ea9ad33

Browse files
committed
[BUG FIX] Fix #4: phpctags does not work with namespaces
1 parent 792b3c7 commit ea9ad33

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

PHPCtags.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ private function struct($node, $reset=FALSE, $parent=array())
111111
}
112112
} elseif ($node instanceof PHPParser_Node_Stmt_Namespace) {
113113
//@todo
114+
foreach ($node as $subNode) {
115+
$this->struct($subNode);
116+
}
114117
} elseif ($node instanceof PHPParser_Node_Expr_Assign) {
115118
if(is_string($node->var->name)) {
116119
$kind = 'v';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
function e_bugfix_0004_define()
3+
{
4+
return array(
5+
array(
6+
'name'=>'Foo',
7+
'kind'=>'c',
8+
'line'=>'4',
9+
'scope'=>'',
10+
'access'=>'',
11+
),
12+
);
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
namespace Bar;
3+
4+
class Foo {
5+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
class t_bugfix_0004 extends PHPCtagsTestCase {
3+
4+
public function __construct()
5+
{
6+
parent::__construct();
7+
$this->mExample = 'bugfix_0004';
8+
}
9+
10+
}

0 commit comments

Comments
 (0)