Skip to content

Commit 2b06269

Browse files
committed
Add support for OPTIONS HTTP method
1 parent 2f23912 commit 2b06269

File tree

4 files changed

+339
-287
lines changed

4 files changed

+339
-287
lines changed

src/WaterPipe/HTTP/Request/RequestMethod.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ abstract class RequestMethod
8181
* @var int
8282
*/
8383
public const PATCH = 6;
84+
85+
/**
86+
* The OPTIONS request method.
87+
* @var int
88+
*/
89+
public const OPTIONS = 7;
8490
}

src/WaterPipe/Routing/Route.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,41 +80,47 @@ public function getUri(): string
8080
* Execute an action when any kind of request method
8181
* is sent to this route.
8282
*/
83-
public abstract function request();
83+
public function request() {}
8484

8585
/**
8686
* Execute an action when a GET request method
8787
* is sent to this route.
8888
*/
89-
public abstract function get();
89+
public function get() {}
9090

9191
/**
9292
* Execute an action when a POST request method
9393
* is sent to this route.
9494
*/
95-
public abstract function post();
95+
public function post() {}
9696

9797
/**
9898
* Execute an action when a PUT request method
9999
* is sent to this route.
100100
*/
101-
public abstract function put();
101+
public function put() {}
102102

103103
/**
104104
* Execute an action when a DELETE request method
105105
* is sent to this route.
106106
*/
107-
public abstract function delete();
107+
public function delete() {}
108108

109109
/**
110110
* Execute an action when a HEAD request method
111111
* is sent to this route.
112112
*/
113-
public abstract function head();
113+
public function head() {}
114114

115115
/**
116116
* Execute an action when a PATCH request method
117117
* is sent to this route.
118118
*/
119-
public abstract function patch();
119+
public function patch() {}
120+
121+
/**
122+
* Execute an action when a OPTIONS request method
123+
* is sent to this route.
124+
*/
125+
public function options() {}
120126
}

0 commit comments

Comments
 (0)