src/Router/Runner/Callback.php
public function run(ServerRequestInterface $request, ResponseInterface $response)
    {
        $route = $request->getAttribute('route');
        $callback = !empty($route->fn) ? $route->fn : null;

        if (!is_callable($callback)) {
            trigger_error("'fn' property of route shoud be a callable", E_USER_NOTICE);
            return $this->notFound($request, $response);
        }

        return $callback($request, $response);
    }
public function run(ServerRequestInterface $request, ResponseInterface $response)
    {
        $route = $request->getAttribute('route');
        $callback = !empty($route->fn) ? $route->fn : null;

        if (!is_callable($callback)) {
            trigger_error("'fn' property of route shoud be a callable", E_USER_NOTICE);
            return $this->notFound($request, $response);
        }

        return $callback($request, $response);
    }
public function run ( ServerRequestInterface $ request , ResponseInterface $ response ) { $ route = $ request -> getAttribute ( 'route' ) ; $ callback = ! empty ( $ route -> fn ) ? $ route -> fn : null ; if ( ! is_callable ( $ callback ) ) { trigger_error ( "'fn' property of route shoud be a callable" , E_USER_NOTICE ) ; return $ this -> notFound ( $ request , $ response ) ; } return $ callback ( $ request , $ response ) ; }
Use function to handle request and response

@param ServerRequestInterface $request
@param ResponseInterface      $response
@return ResponseInterface|mixed
Use function to handle request and response