addClassConstant() public method

public addClassConstant ( Phan\Language\Element\ClassConstant $class_constant ) : void
$class_constant Phan\Language\Element\ClassConstant A class constant to add to the code base
return void
Exemplo n.º 1
0
Arquivo: Clazz.php Projeto: etsy/phan
 /**
  * Add a class constant
  *
  * @return null;
  */
 public function addConstant(CodeBase $code_base, ClassConstant $constant)
 {
     $constant_fqsen = FullyQualifiedClassConstantName::make($this->getFQSEN(), $constant->getName());
     // Update the FQSEN if its not associated with this
     // class yet
     if ($constant->getFQSEN() !== $constant_fqsen) {
         $constant = clone $constant;
         $constant->setFQSEN($constant_fqsen);
     }
     $code_base->addClassConstant($constant);
 }