This repository was archived by the owner on Sep 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -79,20 +79,23 @@ public static function getUri()
79
79
*/
80
80
public static function getData ($ extended = true )
81
81
{
82
- switch (static ::getMethod ()) {
82
+ $ method = static ::getMethod ();
83
+
84
+ switch ($ method ) {
83
85
case Request::METHOD_GET :
84
86
return $ _GET ;
85
87
86
88
case Request::METHOD_POST :
89
+ case Request::METHOD_PUT :
90
+ case Request::METHOD_PATCH :
87
91
$ contentType = static ::getHeader ('Content-Type ' );
88
92
89
93
switch ($ contentType ) {
90
94
case 'application/x-www-form-urlencoded ' :
91
- return $ _POST ;
95
+ return $ { ' _ ' . strtoupper ( $ method )} ;
92
96
93
97
case 'application/json ' :
94
98
$ input = file_get_contents ('php://input ' );
95
-
96
99
if (true !== $ extended ||
97
100
true !== function_exists ('json_decode ' )) {
98
101
return $ input ;
@@ -110,12 +113,6 @@ public static function getData($extended = true)
110
113
return file_get_contents ('php://input ' );
111
114
}
112
115
113
- break ;
114
-
115
- case Request::METHOD_PUT :
116
- case Request::METHOD_PATCH :
117
- return file_get_contents ('php://input ' );
118
-
119
116
default :
120
117
return null ;
121
118
}
You can’t perform that action at this time.
0 commit comments