| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 2 | public static function getDataPointer($path) { |
|
| 17 | 2 | $items = explode('->', $path); |
|
| 18 | 2 | unset($items[0]); |
|
| 19 | 2 | $result = '#'; |
|
| 20 | 2 | foreach ($items as $item) { |
|
| 21 | 1 | $parts = explode(':', $item); |
|
| 22 | 1 | if (isset($parts[1])) { |
|
| 23 | 1 | $result .= '/' . JsonPointer::escapeSegment($parts[1], true); |
|
| 24 | } |
||
| 25 | } |
||
| 26 | 2 | return $result; |
|
| 27 | } |
||
| 29 | } |