Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 10 | protected function toJsonPointer(string $path): string |
|
18 | { |
||
19 | 10 | if (empty($path = trim($path))) { |
|
20 | 9 | return ''; |
|
21 | } |
||
22 | |||
23 | // @todo replace * with - after https://github.com/halaxa/json-machine/pull/47 is merged: |
||
24 | // return '/' . str_replace(['~', '/', '.', '*'], ['~0', '~1', '/', '-'], $path); |
||
25 | 1 | return '/' . str_replace(['~', '/', '.'], ['~0', '~1', '/'], $path); |
|
26 | } |
||
28 |