MCPcopy Create free account
hub / github.com/Rello/analytics / extractRowsFromArray

Method extractRowsFromArray

lib/Datasource/LocalJson.php:195–205  ·  view source on GitHub ↗

* Extracts rows from an array of arrays, using the provided paths. */

($json, array $paths)

Source from the content-addressed store, hash-verified

193 * Extracts rows from an array of arrays, using the provided paths.
194 */
195 private function extractRowsFromArray($json, array $paths): array {
196 $data = [];
197 if (is_array($json) && is_array(reset($json))) {
198 foreach ($json as $rowArray) {
199 $data[] = $this->extractRow($rowArray, $paths);
200 }
201 } else {
202 $data[] = $this->extractRow($json, $paths);
203 }
204 return $data;
205 }
206
207 /**
208 * Extracts a single row's values based on the given paths.

Callers 1

jsonParserMethod · 0.95

Calls 2

extractRowMethod · 0.95
resetFunction · 0.85

Tested by

no test coverage detected