public function withParameter(string $parameterName, $parameterValue): self
    {
        if (!TypeHandling::isLiteral(gettype($parameterValue)) && (!$parameterValue instanceof CacheAwareInterface)) {
            throw new \InvalidArgumentException(sprintf('Parameter values must be literal types or implement the CacheAwareInterface, given: "%s"', is_object($parameterValue) ? get_class($parameterValue) : gettype($parameterValue)), 1511194273);
        }
        $newParameters = $this->parameters;
        $newParameters[$parameterName] = $parameterValue;
        return new static($newParameters);
    }
public function withParameter(string $parameterName, $parameterValue): self
    {
        if (!TypeHandling::isLiteral(gettype($parameterValue)) && (!$parameterValue instanceof CacheAwareInterface)) {
            throw new \InvalidArgumentException(sprintf('Parameter values must be literal types or implement the CacheAwareInterface, given: "%s"', is_object($parameterValue) ? get_class($parameterValue) : gettype($parameterValue)), 1511194273);
        }
        $newParameters = $this->parameters;
        $newParameters[$parameterName] = $parameterValue;
        return new static($newParameters);
    }
public function withParameter ( string $ parameterName , $ parameterValue ) : self { if ( ! TypeHandling :: isLiteral ( gettype ( $ parameterValue ) ) && ( ! $ parameterValue instanceof CacheAwareInterface ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Parameter values must be literal types or implement the CacheAwareInterface, given: "%s"' , is_object ( $ parameterValue ) ? get_class ( $ parameterValue ) : gettype ( $ parameterValue ) ) , 1511194273 ) ; } $ newParameters = $ this -> parameters ; $ newParameters [ $ parameterName ] = $ parameterValue ; return new static ( $ newParameters ) ; }
Create a new instance adding the given parameter

@param string $parameterName name of the parameter to add
@param bool|float|int|string|CacheAwareInterface $parameterValue value of the parameter, has to be a literal or an object implementing CacheAwareInterface
@return RouteParameters a new instance with the given parameters added
Create a new instance adding the given parameter