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

Method normalizePaths

lib/Datasource/ExternalJson.php:218–224  ·  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

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

Callers 1

jsonParserMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected