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

Method decodeJsonInput

lib/Datasource/ExternalJson.php:181–193  ·  view source on GitHub ↗

* Decode JSON input, supporting both standard and line-delimited JSON. */

(string $rawResult)

Source from the content-addressed store, hash-verified

179 * Decode JSON input, supporting both standard and line-delimited JSON.
180 */
181 private function decodeJsonInput(string $rawResult) {
182 $json = json_decode($rawResult, true);
183 if ($json === null && trim($rawResult) !== '') {
184 $json = [];
185 foreach (explode("\n", trim($rawResult)) as $line) {
186 $decoded = json_decode($line, true);
187 if ($decoded !== null) {
188 $json[] = $decoded;
189 }
190 }
191 }
192 return $json;
193 }
194
195 /**
196 * Extracts fields inside curly braces from the path string.

Callers 1

jsonParserMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected