src/PropertyBag.php
public function add(Property $property)
    {
        $name = $property->getName();

        if (isset($this->elements[$name])) {
            throw new \Exception("Property with name '{$name}' already exists");
        }

        $this->elements[$name] = $property;

        return $this;
    }
public function add(Property $property)
    {
        $name = $property->getName();

        if (isset($this->elements[$name])) {
            throw new \Exception("Property with name '{$name}' already exists");
        }

        $this->elements[$name] = $property;

        return $this;
    }
public function add ( Property $ property ) { $ name = $ property -> getName ( ) ; if ( isset ( $ this -> elements [ $ name ] ) ) { throw new \ Exception ( "Property with name '{$name}' already exists" ) ; } $ this -> elements [ $ name ] = $ property ; return $ this ; }
Adds a Property. If Property already exists an Exception will be thrown.

@param Property $property

@return $this

@throws \Exception
Adds a Property . If Property already exists an Exception will be thrown .