logger->log( LogLevel::WARNING, LocalizationUtility::translate('system.warning.json.encode', 'ThRating', [ 1 => $content, ]), [ 'errorCode' => 1615051494, 'JSON' => $content, 'Exception' => $e, ] ); } } return false; } /** * Encode a string to JSON * Log a warning on error * * @param string|null $content * @return array|false The domain to be used on setting cookies */ public function decodeJsonToArray(string $content=null) { if (!empty($content)) { try { return json_decode($content, true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { $this->logger->log( LogLevel::WARNING, LocalizationUtility::translate('system.warning.json.encode', 'ThRating', [ 1 => $content, ]), [ 'errorCode' => 1615051494, 'JSON' => $content, 'Exception' => $e, ] ); } } return false; } }