public function withHostSuffix(string $suffix, array $replaceSuffixes = []): self
    {
        $newConstraints = $this->constraints;
        $newConstraints[self::CONSTRAINT_HOST_SUFFIX] = [
            'suffix' => $suffix,
            'replaceSuffixes' => $replaceSuffixes,
        ];
        return new static($newConstraints);
    }
public function withHostSuffix(string $suffix, array $replaceSuffixes = []): self
    {
        $newConstraints = $this->constraints;
        $newConstraints[self::CONSTRAINT_HOST_SUFFIX] = [
            'suffix' => $suffix,
            'replaceSuffixes' => $replaceSuffixes,
        ];
        return new static($newConstraints);
    }
public function withHostSuffix ( string $ suffix , array $ replaceSuffixes = [ ] ) : self { $ newConstraints = $ this -> constraints ; $ newConstraints [ self :: CONSTRAINT_HOST_SUFFIX ] = [ 'suffix' => $ suffix , 'replaceSuffixes' => $ replaceSuffixes , ] ; return new static ( $ newConstraints ) ; }
Create a new instance with the host suffix constraint added

@param string $suffix The URI host suffix to force, for example ".com"
@param string[] $replaceSuffixes a list of prefixes that should be replaced with the given prefix. if the list is empty or does not match the current host $prefix will be prepended as is
@return UriConstraints
Create a new instance with the host suffix constraint added