withStatus($code, $reason); } if (class_exists(NyholmResponse::class)) { return new NyholmResponse($code, [], null, "1.1", $reason); } if (class_exists(SlimPsr7ResponseFactory::class)) { return (new SlimPsr7ResponseFactory)->createResponse($code, $reason); } if (class_exists(SlimResponse::class)) { return (new SlimResponse)->withStatus($code, $reason); } if (class_exists(GuzzleResponse::class)) { return new GuzzleResponse($code, [], null, "1.1", $reason); } throw new \RuntimeException("No PSR-7 implementation available"); } }