Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | public function extract(&$n, TokenCollection $tokens) |
||
43 | { |
||
44 | $alias = $real = null; |
||
45 | $expression = $this->searcher->getUnder(array(';'), $n, $tokens); |
||
46 | if(preg_match('!use\s+(.*)\s+as\s+(.*)!i', $expression, $matches)) { |
||
47 | list(, $real, $alias) = $matches; |
||
48 | } else if(preg_match('!use\s+([^\s\(]+)\s*!i', $expression, $matches)) { |
||
49 | list(, $real) = $matches; |
||
50 | $alias = $real; |
||
51 | } |
||
52 | |||
53 | return (object) array( |
||
54 | 'name' => $real |
||
55 | , 'alias' => $alias |
||
56 | ); |
||
57 | } |
||
58 | }; |
||
59 |