Skip to content

Commit 9dc1b12

Browse files
markwuweynhamz
authored andcommitted
Add trait support
1 parent 251d5f0 commit 9dc1b12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

PHPCtags.class.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class PHPCtags
1515
'd' => 'constant',
1616
'v' => 'variable',
1717
'i' => 'interface',
18+
't' => 'trait',
1819
);
1920

2021
private $mParser;
@@ -181,6 +182,13 @@ private function struct($node, $reset=FALSE, $parent=array())
181182
foreach ($node as $subNode) {
182183
$this->struct($subNode, FALSE, array('interface' => $name));
183184
}
185+
} elseif ($node instanceof PHPParser_Node_Stmt_Trait ) {
186+
$kind = 't';
187+
$name = $node->name;
188+
$line = $node->getLine();
189+
foreach ($node as $subNode) {
190+
$this->struct($subNode, FALSE, array('trait' => $name));
191+
}
184192
} elseif ($node instanceof PHPParser_Node_Stmt_Namespace) {
185193
//@todo
186194
foreach ($node as $subNode) {

0 commit comments

Comments
 (0)