CapMousse\ReactRestify\Routing\Route::parse PHP Method

parse() public method

Parse route uri
public parse ( ) : void
return void
    public function parse()
    {
        preg_match_all("#\\{(\\w+)\\}#", $this->uri, $params);
        $replace = array();
        foreach ($params[1] as $param) {
            $replace['{' . $param . '}'] = '(?<' . $param . '>' . (isset($this->filters[$param]) ? $this->filters[$param] : '[a-zA-Z+0-9-.]+') . ')';
        }
        $this->parsed = str_replace(array_keys($replace), array_values($replace), $this->uri);
    }