private function insertMethod(Method $method, $packageVersionId)
 {
     $this->methodStmt->bindValue(1, $this->phpType->convertToDatabaseValue($method->getReturnType(), $this->platform));
     $this->methodStmt->bindValue(2, $method->getName());
     $this->methodStmt->bindValue(3, $method->isReturnByRef() ? 1 : 0, \PDO::PARAM_INT);
     $this->methodStmt->bindValue(4, $method->getModifier(), \PDO::PARAM_INT);
     $this->methodStmt->bindValue(5, $method->getVisibility(), \PDO::PARAM_INT);
     $this->methodStmt->bindValue(6, $packageVersionId, \PDO::PARAM_INT);
     $this->methodStmt->bindValue(7, $method->hasVariableParameters() ? 1 : 0, \PDO::PARAM_INT);
     $this->methodStmt->bindValue(8, json_encode($method->getDocTypes()), \PDO::PARAM_STR);
     $this->methodStmt->execute();
     $this->methodIdRef->setValue($method, $methodId = $this->con->lastInsertId());
     foreach ($method->getParameters() as $param) {
         $this->paramPersister->persist($param, $method);
     }
     foreach ($method->getInCallSites() as $callSite) {
         $this->callSitePersister->persist($callSite);
     }
     foreach ($method->getOutCallSites() as $callSite) {
         $this->callSitePersister->persist($callSite);
     }
     return $methodId;
 }