Skip to content

Commit 4b19690

Browse files
Олегweierophinney
authored andcommitted
Create RequestMethodInterface.php
Example: <?php class Request extends ServerRequest implements RequestInterface, RequestMethodInterface { public function __construct( $uri = '/', RequestMethodInterface $method = Request::METHOD_GET, array $server = array(), array $query = array(), array $parsedBody = array(), array $cookies = array(), array $files = array() ) { //... } } $request = new Http\Request( '/', Request::METHOD_GET, $GLOBALS['_SERVER'], $GLOBALS['_GET'], $GLOBALS['_POST'], $GLOBALS['_COOKIE'], $GLOBALS['_FILES'] );
1 parent e40e168 commit 4b19690

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/RequestMethodInterface.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
namespace Psr\Http\Message;
3+
4+
/**
5+
* The interface defines constants request method
6+
*/
7+
interface RequestMethodInterface {
8+
const METHOD_HEAD = 'HEAD';
9+
const METHOD_GET = 'GET';
10+
const METHOD_POST = 'POST';
11+
const METHOD_PUT = 'PUT';
12+
const METHOD_PATCH = 'PATCH';
13+
const METHOD_DELETE = 'DELETE';
14+
const METHOD_PURGE = 'PURGE';
15+
const METHOD_OPTIONS = 'OPTIONS';
16+
const METHOD_TRACE = 'TRACE';
17+
const METHOD_CONNECT = 'CONNECT';
18+
}

0 commit comments

Comments
 (0)