private function insertConstant(Constant $constant, $packageVersionId)
 {
     $this->constantStmt->bindValue(1, $constant->getName());
     $this->constantStmt->bindValue(2, $this->phpType->convertToDatabaseValue($constant->getPhpType(), $this->platform));
     $this->constantStmt->bindValue(3, $packageVersionId);
     $this->constantStmt->execute();
     $constantId = $this->con->lastInsertId();
     $this->constantIdRef->setValue($constant, $constantId);
     return $constantId;
 }
 private function inferTypesForClassConstant(Constant $constant)
 {
     if (($type = $constant->getPhpType()) && !$type->isUnknownType()) {
         return;
     }
     if (null !== ($node = $constant->getAstNode())) {
         $type = $this->parser->getTypeFromVarAnnotation($node);
     }
     if (null === $type) {
         $type = $this->registry->getNativeType('unknown');
     }
     $constant->setPhpType($type);
     if ($node) {
         $node->setAttribute('type', $type);
     }
 }