src/Http.php
public static function getParams(array $methods = null) {
    if(null === $methods) {
      $methods = [self::getMethod()];
    }
    $params = [];
    if($methods) {
      // This will uniquefy the methods.
      $methods = array_flip(array_flip($methods));

      // Run over the methods.
      foreach($methods as $method) {
        switch(strtoupper($method)) {
          case 'GET':
            $params = array_merge($params, $_GET);
            break;
          case 'POST':
            $params = array_merge($params, $_POST);
            break;
        }
      }
    }
    return $params;
  }
public static function getParams(array $methods = null) {
    if(null === $methods) {
      $methods = [self::getMethod()];
    }
    $params = [];
    if($methods) {
      // This will uniquefy the methods.
      $methods = array_flip(array_flip($methods));

      // Run over the methods.
      foreach($methods as $method) {
        switch(strtoupper($method)) {
          case 'GET':
            $params = array_merge($params, $_GET);
            break;
          case 'POST':
            $params = array_merge($params, $_POST);
            break;
        }
      }
    }
    return $params;
  }
public static function getParams ( array $ methods = null ) { if ( null === $ methods ) { $ methods = [ self :: getMethod ( ) ] ; } $ params = [ ] ; if ( $ methods ) { // This will uniquefy the methods. $ methods = array_flip ( array_flip ( $ methods ) ) ; // Run over the methods. foreach ( $ methods as $ method ) { switch ( strtoupper ( $ method ) ) { case 'GET' : $ params = array_merge ( $ params , $ _GET ) ; break ; case 'POST' : $ params = array_merge ( $ params , $ _POST ) ; break ; } } } return $ params ; }
Returns a list of parameters associated with the last request.

If the specified parameter is NULL, then the list depends on the method
used. So a GET request will get return query parameters, while a POST
request will return those.

To change this behavior, send in a list of the types to consider, as an
array of method types.

@param array $methods list to consider
@return array list of parameters (might be an empty array)
Returns a list of parameters associated with the last request .