Library/ClassDefinition.php
public function addConstant(ClassConstant $constant)
    {
        if (isset($this->constants[$constant->getName()])) {
            throw new CompilerException("Constant '".$constant->getName()."' was defined more than one time");
        }

        $this->constants[$constant->getName()] = $constant;
    }
public function addConstant(ClassConstant $constant)
    {
        if (isset($this->constants[$constant->getName()])) {
            throw new CompilerException("Constant '".$constant->getName()."' was defined more than one time");
        }

        $this->constants[$constant->getName()] = $constant;
    }
public function addConstant ( ClassConstant $ constant ) { if ( isset ( $ this -> constants [ $ constant -> getName ( ) ] ) ) { throw new CompilerException ( "Constant '" . $ constant -> getName ( ) . "' was defined more than one time" ) ; } $ this -> constants [ $ constant -> getName ( ) ] = $ constant ; }
Adds a constant to the definition.

@param ClassConstant $constant

@throws CompilerException
Adds a constant to the definition .