From 5b50afdcafd150186ea5c7b0e1cad98065590b35 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 28 Aug 2026 18:44:28 +0000
Subject: [PATCH] =A few more phpStorm suggestions, mainly in PHPDocs
---
inc/registrar/helpers/AddIntegrationFields.php | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/inc/registrar/helpers/AddIntegrationFields.php b/inc/registrar/helpers/AddIntegrationFields.php
index 952cd51..1a6fe68 100644
--- a/inc/registrar/helpers/AddIntegrationFields.php
+++ b/inc/registrar/helpers/AddIntegrationFields.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\registrar\helpers;
+use JVBase\integrations\ServiceMap;
use JVBase\registrar\config\Integration;
use JVBase\registrar\Registrar;
use JVBase\base\Site;
@@ -10,6 +11,7 @@
}
class AddIntegrationFields {
+ use ServiceMap;
protected string $service_name;
private Registrar $registrar;
protected Integration $config;
@@ -65,8 +67,9 @@
public function getIntegrationFields():array
{
- if ($this->registrar && $this->registrar->getType() === 'user' && $this->config->isCustomer()) {
- return JVB()->connect($this->service_name)->getAdditionalFields('customer');
+ if (!$this->getService($this->service_name)) {
+ error_log('Attempted to connect to unsupported service: '.$this->service_name);
+ return [];
}
$fields = [
'share_to_'.$this->service_name => [
@@ -134,8 +137,13 @@
'default' => 1,
];
}
- $additional = JVB()->connect($this->service_name)->getAdditionalFields($this->config->getContentType());
+
+ $additional = $this->getService($this->service_name)->getAdditionalFields($this->config->getContentType());
if (!empty($additional)) {
+ $additional = array_combine(
+ array_map(fn($k) => str_starts_with($k, '_'.$this->service_name) ? $k : "_{$this->service_name}_{$k}", array_keys($additional)),
+ $additional
+ );
$fields = array_merge($fields, $additional);
}
return $fields;
--
Gitblit v1.10.0