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/rest/routes/NotificationsRoutes.php | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/inc/rest/routes/NotificationsRoutes.php b/inc/rest/routes/NotificationsRoutes.php
index 0e9bd82..ac1ea1a 100644
--- a/inc/rest/routes/NotificationsRoutes.php
+++ b/inc/rest/routes/NotificationsRoutes.php
@@ -1,13 +1,11 @@
<?php
namespace JVBase\rest\routes;
-use JVBase\base\Site;
use JVBase\Instance;
-use JVBase\managers\Approvals;
use JVBase\managers\Cache;
use JVBase\managers\CustomTable;
use JVBase\managers\NotificationManager;
-use JVBase\registrar\Registrar;
+use JVBase\managers\queue\Queue;
use JVBase\rest\Rest;
use JVBase\rest\Route;
use WP_REST_Request;
@@ -337,7 +335,7 @@
'action_user_id' => $group->action_user_id,
'type' => $group->type
])
- ->orderBy('created_at', 'DESC')
+ ->orderBy('created_at')
->first();
if ($notification) {
@@ -1042,19 +1040,10 @@
*/
protected function getItemLink(int $ID, string $content): string
{
- switch ($content) {
- case BASE.'artist':
- case BASE.'artwork':
- case BASE.'event':
- case BASE.'news':
- case BASE.'offer':
- case BASE.'partner':
- case BASE.'piercing':
- case BASE.'tattoo':
- return get_permalink($ID);
- default:
- return get_term_link($ID, BASE.$content);
- }
+ return match ($content) {
+ BASE . 'artist', BASE . 'artwork', BASE . 'event', BASE . 'news', BASE . 'offer', BASE . 'partner', BASE . 'piercing', BASE . 'tattoo' => get_permalink($ID),
+ default => get_term_link($ID, BASE . $content),
+ };
}
/**
@@ -1143,7 +1132,7 @@
return $irregular[$word];
}
- if (substr($word, -1) === 'y') {
+ if (str_ends_with($word, 'y')) {
return substr($word, 0, -1) . 'ies';
}
--
Gitblit v1.10.0