public function addConstant(ClassConstantGenerator $constant)
    {
        $name = $constant->getName();
        if (isset($this->constants[$name]) === true) {
            throw new InvalidArgumentException('Constant name "' . $name . '" already added.');
        }

        $this->constants[$name] = $constant;
    }
public function addConstant(ClassConstantGenerator $constant)
    {
        $name = $constant->getName();
        if (isset($this->constants[$name]) === true) {
            throw new InvalidArgumentException('Constant name "' . $name . '" already added.');
        }

        $this->constants[$name] = $constant;
    }
public function addConstant ( ClassConstantGenerator $ constant ) { $ name = $ constant -> getName ( ) ; if ( isset ( $ this -> constants [ $ name ] ) === true ) { throw new InvalidArgumentException ( 'Constant name "' . $ name . '" already added.' ) ; } $ this -> constants [ $ name ] = $ constant ; }
Add a constant.

@param \Wingu\OctopusCore\CodeGenerator\PHP\OOP\ClassConstantGenerator $constant The constant to add.
@throws \Wingu\OctopusCore\CodeGenerator\Exceptions\InvalidArgumentException If the constant name already exists.
Add a constant .