src/UriHandler.php
private function fetchOptions($parameters, &$query): array
    {
        $allowed = array_keys($this->options);

        $result = [];
        foreach ($parameters as $key => $parameter) {
            if (is_numeric($key) && isset($allowed[$key])) {
                // this segment fetched keys from given parameters either by name or by position
                $key = $allowed[$key];
            } elseif (!array_key_exists($key, $this->options) && is_array($parameters)) {
                // all additional parameters given in array form can be glued to query string
                $query[$key] = $parameter;
                continue;
            }

            //String must be normalized here
            if (is_string($parameter) && !preg_match('/^[a-z\-_0-9]+$/i', $parameter)) {
                $result[$key] = $this->slugify->slugify($parameter);
                continue;
            }

            $result[$key] = (string)$parameter;
        }

        return $result;
    }
private function fetchOptions($parameters, &$query): array
    {
        $allowed = array_keys($this->options);

        $result = [];
        foreach ($parameters as $key => $parameter) {
            if (is_numeric($key) && isset($allowed[$key])) {
                // this segment fetched keys from given parameters either by name or by position
                $key = $allowed[$key];
            } elseif (!array_key_exists($key, $this->options) && is_array($parameters)) {
                // all additional parameters given in array form can be glued to query string
                $query[$key] = $parameter;
                continue;
            }

            //String must be normalized here
            if (is_string($parameter) && !preg_match('/^[a-z\-_0-9]+$/i', $parameter)) {
                $result[$key] = $this->slugify->slugify($parameter);
                continue;
            }

            $result[$key] = (string)$parameter;
        }

        return $result;
    }
private function fetchOptions ( $ parameters , & $ query ) : array { $ allowed = array_keys ( $ this -> options ) ; $ result = [ ] ; foreach ( $ parameters as $ key => $ parameter ) { if ( is_numeric ( $ key ) && isset ( $ allowed [ $ key ] ) ) { // this segment fetched keys from given parameters either by name or by position $ key = $ allowed [ $ key ] ; } elseif ( ! array_key_exists ( $ key , $ this -> options ) && is_array ( $ parameters ) ) { // all additional parameters given in array form can be glued to query string $ query [ $ key ] = $ parameter ; continue ; } //String must be normalized here if ( is_string ( $ parameter ) && ! preg_match ( '/^[a-z\-_0-9]+$/i' , $ parameter ) ) { $ result [ $ key ] = $ this -> slugify -> slugify ( $ parameter ) ; continue ; } $ result [ $ key ] = ( string ) $ parameter ; } return $ result ; }
Fetch uri segments and query parameters.

@param \Traversable|array $parameters
@param array|null         $query Query parameters.
@return array
Fetch uri segments and query parameters .