src/Core/Router.php
protected function getRequestDataByMethod($method = HttpMethods::GET)
    {
        switch ($method) {
            // POST method
            case HttpMethods::POST:
                $postData = array_merge($_GET, $_POST);
                return $postData ?: [];
                break;
            // PUT method
            case HttpMethods::PUT:
            // PATH method
            case HttpMethods::PATCH:
                $data = $this->cypher->decode(file_get_contents('php://input'));
                parse_str($data, $patchData);
                $patchData = array_merge($_GET, $patchData);
                return $patchData ?: [];
                break;

            // methods with empty payload
            case HttpMethods::DELETE:
            case HttpMethods::HEAD:
            case HttpMethods::OPTIONS:
                return [];
                break;

            // GET method (default)
            case HttpMethods::GET:
            default:
                return $_GET;
                break;
        }
    }
protected function getRequestDataByMethod($method = HttpMethods::GET)
    {
        switch ($method) {
            // POST method
            case HttpMethods::POST:
                $postData = array_merge($_GET, $_POST);
                return $postData ?: [];
                break;
            // PUT method
            case HttpMethods::PUT:
            // PATH method
            case HttpMethods::PATCH:
                $data = $this->cypher->decode(file_get_contents('php://input'));
                parse_str($data, $patchData);
                $patchData = array_merge($_GET, $patchData);
                return $patchData ?: [];
                break;

            // methods with empty payload
            case HttpMethods::DELETE:
            case HttpMethods::HEAD:
            case HttpMethods::OPTIONS:
                return [];
                break;

            // GET method (default)
            case HttpMethods::GET:
            default:
                return $_GET;
                break;
        }
    }
protected function getRequestDataByMethod ( $ method = HttpMethods :: GET ) { switch ( $ method ) { // POST method case HttpMethods :: POST : $ postData = array_merge ( $ _GET , $ _POST ) ; return $ postData ? : [ ] ; break ; // PUT method case HttpMethods :: PUT : // PATH method case HttpMethods :: PATCH : $ data = $ this -> cypher -> decode ( file_get_contents ( 'php://input' ) ) ; parse_str ( $ data , $ patchData ) ; $ patchData = array_merge ( $ _GET , $ patchData ) ; return $ patchData ? : [ ] ; break ; // methods with empty payload case HttpMethods :: DELETE : case HttpMethods :: HEAD : case HttpMethods :: OPTIONS : return [ ] ; break ; // GET method (default) case HttpMethods :: GET : default : return $ _GET ; break ; } }
Returns the incoming array of parameters based on the type of the request

@param string $method
@return array
Returns the incoming array of parameters based on the type of the request