コード例 #1
0
 public function addConstant(ClassConstNode $node)
 {
     foreach ($node->consts as $const) {
         $constant = new ReflectionConstant($const->name);
         $constant->setStartLine((int) $node->getAttribute('startLine'));
         $constant->setEndLine((int) $node->getAttribute('endLine'));
         $constant->setDocComment((string) $node->getDocComment());
         $constant->setValue($this->resolveValue($const->value));
         $this->context->getReflection()->addConstant($constant);
     }
 }
コード例 #2
0
 /**
  * Add a constant to an entity.
  *
  * @param ReflectionConstant $constant
  */
 public function addConstant(ReflectionConstant $constant)
 {
     $this->constants[$constant->getShortName()] = $constant;
     $constant->setDeclaringClassLike($this);
     $constant->setFilename($this->getFileName());
     return $this;
 }