From a9654f00c8fbc9934289d761843ddd071025013f Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 28 Aug 2026 17:20:28 +0000
Subject: [PATCH] =PHPStorm Code Inspection: fixed class reference errors (from getting rid of JVB() and replacing with direct class::getInstance; as well as general code sniffing, etc
---
inc/integrations/services/HelcimOld.php | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/inc/integrations/services/HelcimOld.php b/inc/integrations/services/HelcimOld.php
index acc53d8..2427efe 100644
--- a/inc/integrations/services/HelcimOld.php
+++ b/inc/integrations/services/HelcimOld.php
@@ -1,11 +1,17 @@
<?php
namespace JVBase\integrations\services;
+use Exception;
use JVBase\integrations\Integrations;
use JVBase\managers\queue\executors\IntegrationExecutor;
+use JVBase\managers\queue\Queue;
use JVBase\managers\queue\TypeConfig;
use JVBase\meta\Meta;
use JVBase\ui\Checkout;
+use WP_Error;
+use WP_Post;
+use WP_REST_Request;
+use WP_REST_Response;
if (!defined('ABSPATH')) {
exit;
@@ -999,7 +1005,7 @@
* PRODUCT SYNC
*****************************************************************/
- protected function handleTheSavePost(int $postID, \WP_Post $post, bool $update, array $settings): void
+ protected function handleTheSavePost(int $postID, WP_Post $post, bool $update, array $settings): void
{
error_log('==== [Helcim]::handleTheSavePost ====');
@@ -1265,7 +1271,7 @@
/**
* Override the webhook request handler to capture raw body for signature verification
*/
- public function handleWebhookRequest(\WP_REST_Request $request): \WP_REST_Response
+ public function handleWebhookRequest(WP_REST_Request $request): WP_REST_Response
{
$payload = $request->get_params();
$payload['_headers'] = $request->get_headers();
@@ -1273,7 +1279,7 @@
$success = $this->handleWebhook($payload);
- return new \WP_REST_Response([
+ return new WP_REST_Response([
'success' => $success,
], $success ? 200 : 400);
}
@@ -1284,11 +1290,11 @@
* Sync a WordPress post to Helcim as a product.
* Called by IntegrationExecutor::processSyncTo()
*/
- public function syncPostToService(int $postID): array|\WP_Error
+ public function syncPostToService(int $postID): array|WP_Error
{
$post = get_post($postID);
if (!$post) {
- return new \WP_Error('not_found', "Post {$postID} not found");
+ return new WP_Error('not_found', "Post {$postID} not found");
}
$helcimProductId = get_post_meta($postID, BASE . '_helcim_item_id', true);
@@ -1324,7 +1330,7 @@
* Delete a product from Helcim.
* Called by IntegrationExecutor::processDeleteFrom()
*/
- public function deleteFromService(string $externalId): array|\WP_Error
+ public function deleteFromService(string $externalId): array|WP_Error
{
$response = $this->deleteRequest("products/{$externalId}");
@@ -1338,14 +1344,14 @@
/**
* Build Helcim product payload from a WordPress post.
*/
- protected function buildProductPayload(int $postID): array|\WP_Error
+ protected function buildProductPayload(int $postID): array|WP_Error
{
- $meta = \JVBase\meta\Meta::forPost($postID);
+ $meta = Meta::forPost($postID);
$post = get_post($postID);
$price = $meta->get('price');
if (empty($price) || !is_numeric($price)) {
- return new \WP_Error('invalid_price', "Post {$postID} has no valid price");
+ return new WP_Error('invalid_price', "Post {$postID} has no valid price");
}
return [
--
Gitblit v1.10.0