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/meta/Storage.php |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/inc/meta/Storage.php b/inc/meta/Storage.php
index f5b24a2..433b478 100644
--- a/inc/meta/Storage.php
+++ b/inc/meta/Storage.php
@@ -4,6 +4,7 @@
 use Exception;
 use JVBase\managers\Cache;
 use JVBase\managers\Errors;
+use wpdb;
 
 if (!defined('ABSPATH')) {
 	exit;
@@ -14,7 +15,7 @@
  */
 class Storage
 {
-	protected \wpdb $wpdb;
+	protected wpdb $wpdb;
 
 	public function __construct()
 	{
@@ -174,7 +175,7 @@
 				'item_id' => $item->id,
 				'object_type' => $item->objectType,
 				'fields' => array_keys($dirty)
-			], 'error');
+			]);
 			return false;
 		}
 	}
@@ -188,7 +189,7 @@
 		$config = $item->getFieldConfig($name);
 		if ($config && ($config['type'] ?? '') === 'taxonomy' && !isset($config['taxonomy_type'])) {
 			$taxonomy = jvbCheckBase($config['taxonomy']);
-			wp_set_object_terms($item->id, [], $taxonomy, false);
+			wp_set_object_terms($item->id, [], $taxonomy);
 			return true;
 		}
 
@@ -326,7 +327,7 @@
 				$results[$meta->item()->id ?? 'options'] = false;
 			}
 
-			Errors::getInstance()->log('meta_storage', 'Bulk save failed: ' . $e->getMessage(), [], 'error');
+			Errors::getInstance()->log('meta_storage', 'Bulk save failed: ' . $e->getMessage());
 
 			return $results;
 		}
@@ -541,12 +542,12 @@
 		$taxonomy = jvbCheckBase($field->config['taxonomy']);
 		$value = $field->value;
 		if (empty(trim((string)$value))) {
-			wp_set_object_terms($item->id, [], $taxonomy, false);
+			wp_set_object_terms($item->id, [], $taxonomy);
 			return true;
 		}
 
 		$termIds = array_map('intval', array_filter(explode(',', $value)));
-		$result = wp_set_object_terms($item->id, $termIds, $taxonomy, false);
+		$result = wp_set_object_terms($item->id, $termIds, $taxonomy);
 
 		return !is_wp_error($result);
 	}
@@ -733,7 +734,7 @@
 				? []
 				: array_map('intval', array_filter(explode(',', $update['value'])));
 
-			wp_set_object_terms($update['object_id'], $termIds, $update['taxonomy'], false);
+			wp_set_object_terms($update['object_id'], $termIds, $update['taxonomy']);
 		}
 	}
 

--
Gitblit v1.10.0