Conditions | 4 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
31 | 2 | public function resolve($schema, $currentPointer, $currentScope) |
|
32 | { |
||
33 | 2 | $pointer = pointer($schema); |
|
34 | 2 | $currentPath = ''; |
|
35 | |||
36 | 2 | foreach (explode('/', $currentPointer) as $segment) { |
|
37 | 2 | if (!empty($segment)) { |
|
38 | 2 | $currentPath = pointer_push($currentPath, $segment); |
|
39 | 1 | } |
|
40 | 2 | $id = $pointer->getRaw($currentPath . '/' . $this->keyword); |
|
41 | 2 | if (is_string($id)) { |
|
42 | 2 | $currentScope = resolve_uri($id, $currentScope); |
|
43 | 1 | } |
|
44 | 1 | } |
|
45 | |||
46 | 2 | return $currentScope; |
|
47 | } |
||
48 | } |
||
49 |