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/blocks/FeedBlock.php |  159 +++++++++++++++++++++++++---------------------------
 1 files changed, 77 insertions(+), 82 deletions(-)

diff --git a/inc/blocks/FeedBlock.php b/inc/blocks/FeedBlock.php
index 2cf593c..80d26c3 100644
--- a/inc/blocks/FeedBlock.php
+++ b/inc/blocks/FeedBlock.php
@@ -6,8 +6,6 @@
 use JVBase\registrar\Registrar;
 use JVBase\base\Site;
 use JVBase\forms\TaxonomySelector;
-use JVBase\ui\CRUDSkeleton;
-use WP_Block;
 use WP_Query;
 
 if (!defined('ABSPATH')) {
@@ -794,97 +792,94 @@
 		if (!$isTemplate && empty($value)) {
 			return '';
 		}
-		switch ($fieldName) {
-			case 'post_title':
-				return sprintf(
-					'<h3%s>%s</h3>',
-					$data,
-					$meta && !empty($value) ? $value : '',
-				);
-			case 'post_date':
-			case 'post_modified':
-				return sprintf(
-					'<time%s%s>%s</time>',
-					$data,
-					$meta && !empty($value) ? date('c', strtotime($value)) : '',
-					$meta && !empty($value) ? date('F j, Y', strtotime($value)) : '',
-				);
-		}
-
-		return match ($fieldType) {
-			'date' => sprintf(
+		return match ($fieldName) {
+			'post_title' => sprintf(
+				'<h3%s>%s</h3>',
+				$data,
+				$meta && !empty($value) ? $value : '',
+			),
+			'post_date', 'post_modified' => sprintf(
 				'<time%s%s>%s</time>',
 				$data,
 				$meta && !empty($value) ? date('c', strtotime($value)) : '',
 				$meta && !empty($value) ? date('F j, Y', strtotime($value)) : '',
 			),
-			'datetime' => sprintf(
-				'<time%s%s>%s</time>',
-				$data,
-				$meta && !empty($value) ? date('c', strtotime($value)) : '',
-				$meta && !empty($value) ? date('F j, Y at h:iA', strtotime($value)) : '',
-			),
-			'time' => sprintf(
-				'<time%s%s>%s</time>',
-				$data,
-				$value,
-				$value
-			),
-			'upload' => empty($value) ? sprintf(
-				'<img%s width="300px" height="300px" loading="lazy" decoding="async">',
-				$data
-			) :
-				str_replace('<img', '<img' . $data, jvbFormatImage($value)),
-			'selector' => sprintf(
-				'<ul%s class="terms %s">%s</ul>',
-				$data,
-				$config['taxonomy']??$config['post_type']??$config['role']??'',
-				empty($value) ? sprintf('<li><a>%s</a></li>',
-					$this->iconFor($config)
+			default => match ($fieldType) {
+				'date' => sprintf(
+					'<time%s%s>%s</time>',
+					$data,
+					$meta && !empty($value) ? date('c', strtotime($value)) : '',
+					$meta && !empty($value) ? date('F j, Y', strtotime($value)) : '',
+				),
+				'datetime' => sprintf(
+					'<time%s%s>%s</time>',
+					$data,
+					$meta && !empty($value) ? date('c', strtotime($value)) : '',
+					$meta && !empty($value) ? date('F j, Y at h:iA', strtotime($value)) : '',
+				),
+				'time' => sprintf(
+					'<time%s%s>%s</time>',
+					$data,
+					$value,
+					$value
+				),
+				'upload' => empty($value) ? sprintf(
+					'<img%s width="300px" height="300px" loading="lazy" decoding="async">',
+					$data
 				) :
-					implode('', array_filter(array_map(function ($ID) use ($config) {
-						$type = $config['subtype'];
-						$taxonomy = isset($config['taxonomy']) ? jvbCheckBase($config['taxonomy']) : '';
+					str_replace('<img', '<img' . $data, jvbFormatImage($value)),
+				'selector' => sprintf(
+					'<ul%s class="terms %s">%s</ul>',
+					$data,
+					$config['taxonomy'] ?? $config['post_type'] ?? $config['role'] ?? '',
+					empty($value) ? sprintf('<li><a>%s</a></li>',
+						$this->iconFor($config)
+					) :
+						implode('', array_filter(array_map(function ($ID) use ($config) {
+							$type = $config['subtype'];
+							$taxonomy = isset($config['taxonomy']) ? jvbCheckBase($config['taxonomy']) : '';
 
-						$item = match ($type) {
-							'taxonomy' => get_term($ID, $taxonomy),
-							'user' => get_userdata($ID),
-							'post' => get_post($ID),
-							default => false,
-						};
+							$item = match ($type) {
+								'taxonomy' => get_term($ID, $taxonomy),
+								'user' => get_userdata($ID),
+								'post' => get_post($ID),
+								default => false,
+							};
 
-						if (!$item || is_wp_error($item)) {
-							return '';
-						}
+							if (!$item || is_wp_error($item)) {
+								return '';
+							}
 
-						$icon = $this->iconFor($config);
+							$icon = $this->iconFor($config);
 
-						$name = match ($type) {
-							'taxonomy' => $item->name,
-							'user' => $item->display_name,
-							'post' => $item->post_title,
-							default => '',
-						};
-						$url = match ($type) {
-							'taxonomy' => get_term_link((int)$ID, $taxonomy),
-							'user' => get_the_permalink(get_user_meta($ID, BASE . 'userLink', true)),
-							'post' => get_the_permalink($ID),
-							default => ''
-						};
-						return sprintf(
-							'<li><a href="%s">%s%s</a></li>',
-							$url,
-							!empty($icon) ? jvbIcon($icon) : '',
-							$name
-						);
-					}, explode(',', $value))))
-			),
-			default => sprintf(
-				'<p%s>%s</p>',
-				$data,
-				$value
-			),
+							$name = match ($type) {
+								'taxonomy' => $item->name,
+								'user' => $item->display_name,
+								'post' => $item->post_title,
+								default => '',
+							};
+							$url = match ($type) {
+								'taxonomy' => get_term_link((int)$ID, $taxonomy),
+								'user' => get_the_permalink(get_user_meta($ID, BASE . 'userLink', true)),
+								'post' => get_the_permalink($ID),
+								default => ''
+							};
+							return sprintf(
+								'<li><a href="%s">%s%s</a></li>',
+								$url,
+								!empty($icon) ? jvbIcon($icon) : '',
+								$name
+							);
+						}, explode(',', $value))))
+				),
+				default => sprintf(
+					'<p%s>%s</p>',
+					$data,
+					$value
+				),
+			},
 		};
+
 	}
 	protected function iconFor(array $fieldConfig):string
 	{

--
Gitblit v1.10.0