@param $param
@return array

If $param is an array, return it.
Else parser it to translate a=b&c=d&e[]=f&g[h]=i to
["a"=>"b","c"=>"d","e"=>["f"],"g"=>["h"=>"i"]
355266
protected function filterArrayStrParam($param)
    {
        if (is_array($param)) {
            return $param;
        }

        parse_str($param, $param);

        if (false === $param) {
            return [];
        }

        return $param;
    }
591343
protected function getQueryParam($param, $url) {
    $keys = [];
    $parse = parse_url($url);
    parse_str($parse['query'], $keys);

    if (isset($keys[$param])) {
      return $keys[$param];
    }

    return FALSE;
  }
1288821
public function addArray(array $param = null)
    {
        $this->param = array_merge($this->param, $param);

        return $this;
    }
245446
protected static function paramToString($param)
    {
        if (is_string($param)) {
            return '"' . $param . '"';
        }

        if (is_numeric($param)) {
            return $param;
        }

        if (is_null($param)) {
            return 'NULL';
        }

        if (is_bool($param)) {
            return $param ? 'TRUE' : 'FALSE';
        }

        if (is_resource($param)) {
            return '#resource';
        }

        if (is_callable($param)) {
            if (is_string($param)) {
                return $param;
            }

            if (is_array($param)) {
                if (is_string($param[0])) {
                    return $param[0] . '::' . $param[1];
                } else {
                    return get_class($param[0]) . '->' . $param[1];
                }
            }

            return 'Closure';
        }

        if (is_array($param)) {
            return 'Array(' . count($param) . ')';
        }

        if (is_object($param)) {
            return get_class($param);
        }

        return 'unknown';
    }
349684
public function getParam($param)
    {
        if (!is_string($param)) {
            throw new \Erebot\InvalidValueException('Bad parameter name');
        }
        if (!isset($this->params[$param])) {
            throw new \Erebot\NotFoundException('No such parameter');
        }
        return $this->params[$param];
    }
494894
private function GetParamString($param)
    {
        if ($param === null)
            return "null";
        if (is_string($param))
            return "'" .  addcslashes($param, "'") . "'";
        
        else if (is_bool($param))
            return $param ? "true" : "false";
        
        else if (is_int($param) || is_float($param))
            return (string)$param;
        
        else if ($param instanceof WritableClass)
            return $param->GetNewStatement();
        
        else if (is_array($param))
        {
            $resultArr = array();
            foreach ($param as $key=>$val)
            {
                $resultArr[] = $this->GetParamString($key) . '=>' . $this->GetParamString($val);
            }
            return 'array(' . join (', ' , $resultArr) .')';
        }
        else if ($param instanceof \Phine\Framework\System\Enum)
        {
            $value = $param->Value();
            $class = get_class($param);
            return "\\$class::ByValue('$value')";
        }
        throw new \InvalidArgumentException('A writable class must have primitive types, Enums, arrays and PhpWritable classes as construct params only.');
    }
217631
public function get($param = '')
    {

        if (empty($param)) return false;

        if (!is_array($param) || !property_exists($this->engineVarList, $param)) return false;

        return $this->engineVarList->$param;
    }
359539
protected function getParamDefaultLocal($param)
    {
        $param = $this->getParameter($param);
        if (!is_null($param))
            return $param;

        return $this->getLocal($param);
    }
957219
public static function prepareParams(array $param){

        $fillable = static::getInstance()->getFillables();

        foreach($param as $key => $value){
            if(!in_array($key, $fillable)){
                unset($param[$key]);
            } elseif(!$value){
                unset($param[$key]);
            }
        }

        return $param;
    }
997080
public function assemble($params = [])
    {
        $params = array_merge($this->defaults, $params);
        $parts  = $this->parts;

        $return = [];
        foreach ($parts as $part) {
            if (0 === strpos($part, '~') && 1 !== strpos($part, ':')) {
                continue;
            }
            if (0 === strpos($part, ':')) {
                if (! isset($params[ltrim($part, ':')])) {
                    throw new InvalidArgumentException(sprintf(
                        'Missing value for the placeholder "%s".',
                        $part
                    ));
                }
                $name = ltrim($part, ':');
                if (isset($this->constraints[$name])
                    && ! preg_match(
                            '#\A' . $this->constraints[$name] . '\Z#',
                            $params[$name]
                        )
                ) {
                    throw new InvalidArgumentException(sprintf(
                        'The value "%s" of parameter "%s" must be constrain '
                        . 'with regex "%s".',
                        $params[$name],
                        $name,
                        $this->constraints[$name]
                    ));
                }
                $return[] = Uri::encode($params[$name]);

                continue;
            }
            if (1 === strpos($part, ':')) {
                $name = ltrim($part, '~:');
                if (! isset($params[$name])) {
                    continue;
                }
                if (isset($this->constraints[$name])
                    && ! preg_match(
                            '#\A' . $this->constraints[$name] . '\Z#',
                            $params[$name]
                        )
                ) {
                    throw new InvalidArgumentException(sprintf(
                        'The value "%s" of parameter "%s" must be constrain '
                        . 'with regex "%s".',
                        $params[$name],
                        $name,
                        $this->constraints[$name]
                    ));
                }
                $return[] = Uri::encode($params[$name]);

                continue;
            }
            $return[] = Uri::encode(ltrim($part, '~'));
        }

        return '/' . implode('/', $return);
    }
127387
protected static function getValue($param)
    {
        $data = explode(':', $param);

        $result = ['rule' => trim($data[0])];

        $result['value'] = count($data) > 1 ? $data[1] : null;

        return $result;
    }
817541
public static function castToArray($param)
    {
        if ($param instanceof \stdClass) {
            $param = (array) $param;

            return $param;
        }

        if ($param instanceof Arrayable) {
            return $param->toArray();
        }

        return $param;
    }
1124183
public static function getMixedValue(array $data, $param)
    {
        $casted = self::castToArray($param);

        $data['model'] = $param;

        foreach ($data as $key => $value) {
            if (isset($casted[$key])) {
                $data[$key] = $casted[$key];
            }
        }

        return $data;
    }
337309
public function getParam($param = null)
    {
        if (null === $param) {
            return $this->_params;
        }

        return isset($this->_params[$param]) ? $this->_params[$param] : null;
    }
1325806
private function process_parameters($param){
    foreach ($param as $key => $val){
      //$val is an array
      if (\is_array($val)){
        $param[$key] = $this->process_parameters($val);
      }
      else {
        $param[$key] = $this->sanitize($val);
      }
    }
    //Return the processed parameters
    return $param;
  }
974532
protected static function parseParameters($param)
    {
        $result = array();
        $parts = explode('=', trim($param));
        $key = array_shift($parts);
        while (!empty($parts)) {
            $value = array_shift($parts);
            while (('"' == $value{0} || "'" == $value{0}) && false == strrpos($value, $value{0}) && !empty($parts)) {
                $value .= '=' . array_shift($parts);
            }
            if (!empty($value) && !empty($parts) && $pos = strrpos($value, ' ')) {
                $result[$key] = self::__compileVar(trim(substr($value, 0, $pos), '\'"'));
                $key = substr($value, $pos + 1);
            } else {
                $result[$key] = self::__compileVar(trim($value, '\'"'));
            }
        }

        return $result;
    }
1275882
public function getParam($param = null)
    {
        if (null === $param) {
            return $this->params;
        }

        return isset($this->params[$param]) ? $this->params[$param] : null;
    }