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()
7979 */
8080 public static function getData ($ extended = true )
8181 {
82- switch (static ::getMethod ()) {
82+ $ method = static ::getMethod ();
83+
84+ switch ($ method ) {
8385 case Request::METHOD_GET :
8486 return $ _GET ;
8587
8688 case Request::METHOD_POST :
89+ case Request::METHOD_PUT :
90+ case Request::METHOD_PATCH :
8791 $ contentType = static ::getHeader ('Content-Type ' );
8892
8993 switch ($ contentType ) {
9094 case 'application/x-www-form-urlencoded ' :
91- return $ _POST ;
95+ return $ { ' _ ' . strtoupper ( $ method )} ;
9296
9397 case 'application/json ' :
9498 $ input = file_get_contents ('php://input ' );
95-
9699 if (true !== $ extended ||
97100 true !== function_exists ('json_decode ' )) {
98101 return $ input ;
@@ -110,12 +113,6 @@ public static function getData($extended = true)
110113 return file_get_contents ('php://input ' );
111114 }
112115
113- break ;
114-
115- case Request::METHOD_PUT :
116- case Request::METHOD_PATCH :
117- return file_get_contents ('php://input ' );
118-
119116 default :
120117 return null ;
121118 }
You can’t perform that action at this time.
0 commit comments