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

Method normalizePaths

lib/Datasource/ExternalJson.php:219–225  ·  view source on GitHub ↗

* Ensures the paths array has at least $minCount elements, padding with $fill if needed. */

(array $fields, int $minCount, string $fill)

Source from the content-addressed store, hash-verified

217 * Ensures the paths array has at least $minCount elements, padding with $fill if needed.
218 */
219 private function normalizePaths(array $fields, int $minCount, string $fill): array {
220 $paths = array_map('trim', explode(',', $fields[0]));
221 while (count($paths) < $minCount) {
222 array_unshift($paths, $fill);
223 }
224 return $paths;
225 }
226
227 /**
228 * Extracts rows from an array of arrays, using the provided paths.

Callers 1

jsonParserMethod · 0.95

Calls 1

countFunction · 0.50

Tested by

no test coverage detected