public function match(string $uri): bool
    {
        if ($this->uri == $uri) {
            return true;
        }
        $pattern = '/^' . $this->regex . '$/';
        return !is_null($this->regex) && preg_match($pattern, $uri);
    }
public function match(string $uri): bool
    {
        if ($this->uri == $uri) {
            return true;
        }
        $pattern = '/^' . $this->regex . '$/';
        return !is_null($this->regex) && preg_match($pattern, $uri);
    }
public function match ( string $ uri ) : bool { if ( $ this -> uri == $ uri ) { return true ; } $ pattern = '/^' . $ this -> regex . '$/' ; return ! is_null ( $ this -> regex ) && preg_match ( $ pattern , $ uri ) ; }
Verifies if the given uri matches the route definition.

@param string $uri
@return bool
Verifies if the given uri matches the route definition .