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