* If an absolute path precedes the array fields, extract the sub-array. */
($json, string $path)
| 169 | * If an absolute path precedes the array fields, extract the sub-array. |
| 170 | */ |
| 171 | private function extractAbsolutePathIfPresent($json, string $path) { |
| 172 | $firstBracePos = strpos($path, '{'); |
| 173 | if ($firstBracePos !== false && $firstBracePos > 0) { |
| 174 | $absolutePath = substr($path, 0, $firstBracePos); |
| 175 | return $this->get_nested_array_value($json, $absolutePath); |
| 176 | } |
| 177 | return $json; |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Ensures the paths array has at least $minCount elements, padding with $fill if needed. |
no test coverage detected