/** * Add property from PropertyGenerator * * @param PropertyGenerator $property * @throws Exception\InvalidArgumentException * @return ClassGenerator */ public function addPropertyFromGenerator(PropertyGenerator $property) { $propertyName = $property->getName(); if (isset($this->properties[$propertyName])) { throw new Exception\InvalidArgumentException(sprintf('A property by name %s already exists in this class.', $propertyName)); } // backwards compatibility // @todo remove this on next major version if ($property->isConst()) { return $this->addConstantFromGenerator($property); } $this->properties[$propertyName] = $property; return $this; }