1 | <?php |
||
14 | abstract class Http { |
||
15 | const HEAD = 'HEAD'; |
||
16 | const GET = 'GET'; |
||
17 | const POST = 'POST'; |
||
18 | const PUT = 'PUT'; |
||
19 | const DELETE = 'DELETE'; |
||
20 | const PATCH = 'PATCH'; |
||
21 | const OPTIONS = 'OPTIONS'; |
||
22 | const TRACE = 'TRACE'; |
||
23 | public static $methods = array( |
||
24 | 'HEAD' => self::HEAD, |
||
25 | 'GET' => self::GET, |
||
26 | 'POST' => self::POST, |
||
27 | 'PUT' => self::PUT, |
||
28 | 'DELETE' => self::DELETE, |
||
29 | 'PATCH' => self::PATCH, |
||
30 | 'OPTIONS' => self::OPTIONS, |
||
31 | 'TRACE' => self::TRACE, |
||
32 | ); |
||
33 | |||
34 | abstract function post($uri, $payload = null, array $options = array()); |
||
35 | |||
36 | abstract function patch($uri, $payload = null, array $options = array()); |
||
37 | |||
38 | abstract function put($uri, $payload = null, array $options = array()); |
||
39 | |||
40 | abstract function get($uri, array $options = array()); |
||
41 | |||
42 | abstract function head($uri, array $options = array()); |
||
43 | |||
44 | abstract function delete($uri, array $options = array()); |
||
45 | |||
46 | abstract function options($uri, array $options = array()); |
||
47 | |||
48 | abstract function trace($uri, array $options = array()); |
||
49 | |||
50 | /** |
||
51 | * @param $method |
||
52 | * @return bool |
||
53 | */ |
||
54 | public static function hasBody($method){ |
||
57 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.