public function isPath(string $path, bool $isRegex = false) : bool
    {
        if ($isRegex) {
            return preg_match('#^' . $path . '$#', $this->path) === 1;
        } else {
            return $this->path == $path;
        }
    }
public function isPath(string $path, bool $isRegex = false) : bool
    {
        if ($isRegex) {
            return preg_match('#^' . $path . '$#', $this->path) === 1;
        } else {
            return $this->path == $path;
        }
    }
public function isPath ( string $ path , bool $ isRegex = false ) : bool { if ( $ isRegex ) { return preg_match ( '#^' . $ path . '$#' , $ this -> path ) === 1 ; } else { return $ this -> path == $ path ; } }
Gets whether or not the current path matches the input path or regular expression

@param string $path The path or regular expression to match against
If the path is a regular expression, it should not include regex delimiters
@param bool $isRegex True if the path is a regular expression, otherwise false
@return bool True if the current path matched the path, otherwise false
Gets whether or not the current path matches the input path or regular expression