Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 4 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
24 | 9 | public function name($regexp) { |
|
25 | 9 | $subject = $this->rt->get_current_var(); |
|
26 | 9 | if (!($subject instanceof Vars\Variable)) { |
|
27 | throw new \RuntimeException("Could not get current var from runtime."); |
||
28 | } |
||
29 | 9 | $this->rt->current_var_is( |
|
30 | 9 | new Vars\WithName($regexp, $subject)); |
|
31 | |||
32 | 8 | return new ExistingVar($this->rt); |
|
33 | } |
||
34 | } |
||
35 |