32 lines
755 B
PHP
32 lines
755 B
PHP
<?php
|
|
|
|
namespace Interop\Http\Factory;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Psr\Http\Message\UriInterface;
|
|
|
|
interface ServerRequestFactoryInterface
|
|
{
|
|
/**
|
|
* Create a new server request.
|
|
*
|
|
* @param string $method
|
|
* @param UriInterface|string $uri
|
|
*
|
|
* @return ServerRequestInterface
|
|
*/
|
|
public function createServerRequest($method, $uri);
|
|
|
|
/**
|
|
* Create a new server request from server variables.
|
|
*
|
|
* @param array $server Typically $_SERVER or similar structure.
|
|
*
|
|
* @return ServerRequestInterface
|
|
*
|
|
* @throws \InvalidArgumentException
|
|
* If no valid method or URI can be determined.
|
|
*/
|
|
public function createServerRequestFromArray(array $server);
|
|
}
|