You are here

public static function Server::createServerFromRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/Server.php \Zend\Diactoros\Server::createServerFromRequest()

Create a Server instance from an existing request object

Provided a callback, an existing request object, and optionally an existing response object, create and return the Server instance.

If no Response object is provided, one will be created.

Parameters

callable $callback:

ServerRequestInterface $request:

null|ResponseInterface $response:

Return value

static

File

vendor/zendframework/zend-diactoros/src/Server.php, line 136

Class

Server
"Serve" incoming HTTP requests

Namespace

Zend\Diactoros

Code

public static function createServerFromRequest(callable $callback, ServerRequestInterface $request, ResponseInterface $response = null) {
  if (!$response) {
    $response = new Response();
  }
  return new static($callback, $request, $response);
}