Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 /**
  * @return array
  * Get a map from column name to row values for
  * this instance
  */
 public function toRow() : array
 {
     $row = ['scope_name' => $this->primaryKeyValue(), 'fqsen' => (string) $this->constant->getFQSEN(), 'name' => (string) $this->constant->getName(), 'type' => (string) $this->constant->getUnionType(), 'flags' => $this->constant->getFlags(), 'context' => base64_encode(serialize($this->constant->getContext())), 'is_deprecated' => $this->constant->isDeprecated()];
     return $row;
 }