src/ieu/Http/Router.php
private function resultToResponse($result) : Response
	{
		switch (true) {
			// Response object
			case $result instanceof Response:
				return $result;
			// String -> transform to response
			case is_string($result) || is_numeric($result):
				return new Response($result);
			// Array -> transform to json response
			case is_array($result) || is_object($result):
				return new JsonResponse($result);
			default:
				throw new Exception('Invalid route handler return value');
		}
	}
private function resultToResponse($result) : Response
	{
		switch (true) {
			// Response object
			case $result instanceof Response:
				return $result;
			// String -> transform to response
			case is_string($result) || is_numeric($result):
				return new Response($result);
			// Array -> transform to json response
			case is_array($result) || is_object($result):
				return new JsonResponse($result);
			default:
				throw new Exception('Invalid route handler return value');
		}
	}
private function resultToResponse ( $ result ) : Response { switch ( true ) { // Response object
 case $ result instanceof Response : return $ result ; // String -> transform to response
 case is_string ( $ result ) || is_numeric ( $ result ) : return new Response ( $ result ) ; // Array -> transform to json response
 case is_array ( $ result ) || is_object ( $ result ) : return new JsonResponse ( $ result ) ; default : throw new Exception ( 'Invalid route handler return value' ) ; } }
Transforms any skalar handler result to a ieu\Http\Response object

@param  mixed $result
The handler result to be transformed

@return ieu\Http\Response
The response
Transforms any skalar handler result to a ieu \ Http \ Response object