Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
46 | protected function getByReference($ref, $source, $target) |
||
47 | { |
||
48 | $subject = $source; |
||
49 | |||
50 | if ($ref === '$') { |
||
51 | return $source; |
||
52 | } elseif ($ref === '@') { |
||
53 | return $target; |
||
54 | } |
||
55 | |||
56 | if (substr($ref, 0, 2) === '$.') { |
||
57 | $ref = substr($ref, 2); |
||
58 | } elseif (substr($ref, 0, 2) === '@.') { |
||
59 | $ref = substr($ref, 2); |
||
60 | $subject = $target; |
||
61 | } |
||
62 | |||
63 | return DotKey::on($subject)->get($ref); |
||
64 | } |
||
65 | } |
||
66 |