Skip to content

Commit 7672d34

Browse files
committed
Add ServerNormalizerInterface
1 parent 9068d80 commit 7672d34

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/ServerNormalizerInterface.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace HttpSoft\Request;
6+
7+
use Psr\Http\Message\UriInterface;
8+
9+
interface ServerNormalizerInterface
10+
{
11+
/**
12+
* Returns a normalized request method from server parameters.
13+
*
14+
* @param array $server if PHP SAPI is used, it is $_SERVER.
15+
* @return string request method.
16+
*/
17+
public function normalizeMethod(array $server): string;
18+
19+
/**
20+
* Returns a normalized protocol version from server parameters.
21+
*
22+
* @param array $server if PHP SAPI is used, it is $_SERVER.
23+
* @return string protocol version.
24+
*/
25+
public function normalizeProtocolVersion(array $server): string;
26+
27+
/**
28+
* Returns a normalized request URI from server parameters.
29+
*
30+
* @param array $server if PHP SAPI is used, it is $_SERVER.
31+
* @return UriInterface instance.
32+
*/
33+
public function normalizeUri(array $server): UriInterface;
34+
35+
/**
36+
* Returns a primary normalized headers from server parameters.
37+
*
38+
* @param array $server if PHP SAPI is used, it is $_SERVER.
39+
* @return array `name => value` header pairs.
40+
*/
41+
public function normalizeHeaders(array $server): array;
42+
}

tests/ServerRequestTest.php

100755100644
File mode changed.

0 commit comments

Comments
 (0)