public function withPathSuffix(string $pathSuffix, bool $prepend = false): self
    {
        $newConstraints = $this->constraints;
        if (isset($newConstraints[self::CONSTRAINT_PATH_SUFFIX])) {
            $pathSuffix = $prepend ? $pathSuffix . $newConstraints[self::CONSTRAINT_PATH_SUFFIX] : $newConstraints[self::CONSTRAINT_PATH_SUFFIX] . $pathSuffix;
        }
        $newConstraints[self::CONSTRAINT_PATH_SUFFIX] = $pathSuffix;
        return new static($newConstraints);
    }
public function withPathSuffix(string $pathSuffix, bool $prepend = false): self
    {
        $newConstraints = $this->constraints;
        if (isset($newConstraints[self::CONSTRAINT_PATH_SUFFIX])) {
            $pathSuffix = $prepend ? $pathSuffix . $newConstraints[self::CONSTRAINT_PATH_SUFFIX] : $newConstraints[self::CONSTRAINT_PATH_SUFFIX] . $pathSuffix;
        }
        $newConstraints[self::CONSTRAINT_PATH_SUFFIX] = $pathSuffix;
        return new static($newConstraints);
    }
public function withPathSuffix ( string $ pathSuffix , bool $ prepend = false ) : self { $ newConstraints = $ this -> constraints ; if ( isset ( $ newConstraints [ self :: CONSTRAINT_PATH_SUFFIX ] ) ) { $ pathSuffix = $ prepend ? $ pathSuffix . $ newConstraints [ self :: CONSTRAINT_PATH_SUFFIX ] : $ newConstraints [ self :: CONSTRAINT_PATH_SUFFIX ] . $ pathSuffix ; } $ newConstraints [ self :: CONSTRAINT_PATH_SUFFIX ] = $ pathSuffix ; return new static ( $ newConstraints ) ; }
Create a new instance with the path suffix constraint added
This can be applied multiple times, later suffixes will be appended to the end

@param string $pathSuffix The URI path suffix to force, for example ".html"
@param bool $prepend If true the $pathSuffix will be added *before* previous path suffix constraints. By default suffixes are added *after* any existing suffix
@return UriConstraints
Create a new instance with the path suffix constraint added This can be applied multiple times later suffixes will be appended to the end