src/ClassGeneration/PropertyCollection.php
public function add($property)
    {
        if (!$property instanceof PropertyInterface) {
            throw new \InvalidArgumentException(
                'This Property must be a instance of \ClassGeneration\PropertyInterface'
            );
        }
        if ($property->getName() === null) {
            $property->setName('property' . ($this->count() + 1));
        }

        parent::set($property->getName(), $property);

        return true;
    }
public function add($property)
    {
        if (!$property instanceof PropertyInterface) {
            throw new \InvalidArgumentException(
                'This Property must be a instance of \ClassGeneration\PropertyInterface'
            );
        }
        if ($property->getName() === null) {
            $property->setName('property' . ($this->count() + 1));
        }

        parent::set($property->getName(), $property);

        return true;
    }
public function add ( $ property ) { if ( ! $ property instanceof PropertyInterface ) { throw new \ InvalidArgumentException ( 'This Property must be a instance of \ClassGeneration\PropertyInterface' ) ; } if ( $ property -> getName ( ) === null ) { $ property -> setName ( 'property' . ( $ this -> count ( ) + 1 ) ) ; } parent :: set ( $ property -> getName ( ) , $ property ) ; return true ; }
Adds a new Property on the collection.

@param PropertyInterface $property

@return bool
@throws \InvalidArgumentException
Adds a new Property on the collection .