* Extracts rows from an array of arrays, using the provided paths. */
($json, array $paths)
| 228 | * Extracts rows from an array of arrays, using the provided paths. |
| 229 | */ |
| 230 | private function extractRowsFromArray($json, array $paths): array { |
| 231 | $data = []; |
| 232 | if (is_array($json) && is_array(reset($json))) { |
| 233 | foreach ($json as $rowArray) { |
| 234 | $data[] = $this->extractRow($rowArray, $paths); |
| 235 | } |
| 236 | } else { |
| 237 | $data[] = $this->extractRow($json, $paths); |
| 238 | } |
| 239 | return $data; |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Extracts a single row's values based on the given paths. |
no test coverage detected