* If an absolute path precedes the array fields, extract the sub-array. */
($json, string $path)
| 210 | * If an absolute path precedes the array fields, extract the sub-array. |
| 211 | */ |
| 212 | private function extractAbsolutePathIfPresent($json, string $path) { |
| 213 | $firstBracePos = strpos($path, '{'); |
| 214 | if ($firstBracePos !== false && $firstBracePos > 0) { |
| 215 | $absolutePath = substr($path, 0, $firstBracePos); |
| 216 | return $this->get_nested_array_value($json, $absolutePath); |
| 217 | } |
| 218 | return $json; |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Ensures the paths array has at least $minCount elements, padding with $fill if needed. |
no test coverage detected