Nelmio\Alice\Definition\PropertyBag::mergeWith PHP Method

mergeWith() public method

Creates a new instance to which the given properties have been merged. In case of conflicts, the existing values are kept.
public mergeWith ( self $propertyBag ) : self
$propertyBag self
return self
    public function mergeWith(self $propertyBag) : self
    {
        $clone = clone $propertyBag;
        foreach ($this->properties as $name => $property) {
            $clone->properties[$name] = $property;
        }
        return $clone;
    }