diff --git a/src/Controller/AbstractRestfulController.php b/src/Controller/AbstractRestfulController.php index 6fe32646..aa14de33 100644 --- a/src/Controller/AbstractRestfulController.php +++ b/src/Controller/AbstractRestfulController.php @@ -18,7 +18,6 @@ use function call_user_func; use function count; use function explode; -use function function_exists; use function get_debug_type; use function is_array; use function is_callable; @@ -601,22 +600,15 @@ protected function processBodyContent(mixed $request) /** * Decode a JSON string. * - * Uses json_decode by default. If that is not available, raises an exception. + * Uses json_decode by default. * * Marked protected to allow usage from extending classes. * * @param string $string * @return mixed - * @throws Exception\DomainException If no JSON decoding functionality is available. */ protected function jsonDecode($string) { - if (function_exists('json_decode')) { - return json_decode($string, (bool) $this->jsonDecodeType); - } - - throw new DomainException( - 'Unable to parse JSON request, due to missing ext/json' - ); + return json_decode($string, (bool) $this->jsonDecodeType); } }