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

Method decodeJsonInput

lib/Datasource/ExternalJson.php:182–194  ·  view source on GitHub ↗

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

(string $rawResult)

Source from the content-addressed store, hash-verified

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

Callers 1

jsonParserMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected