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/RestRouteManager.php | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/inc/rest/RestRouteManager.php b/inc/rest/RestRouteManager.php
index 34cf72f..6caa539 100644
--- a/inc/rest/RestRouteManager.php
+++ b/inc/rest/RestRouteManager.php
@@ -71,10 +71,10 @@
* @param string $nonceName nonce name to check
* @param string|null $nonce optional additional nonce to check
*
- * @return void|WP_Error
- */
- public function verifyNonce(WP_REST_Request $request, string $nonceName = 'wp_rest', string|null $nonce = null):mixed
- {
+ * @return bool|WP_Error
+ */
+ public function verifyNonce(WP_REST_Request $request, string $nonceName = 'wp_rest', string|null $nonce = null): bool|WP_Error
+ {
$nonce = (!is_null($nonce)) ? $nonce : $request->get_header('X-WP-Nonce');
if (!wp_verify_nonce($nonce, $nonceName)) {
@@ -112,7 +112,7 @@
return false;
}
// Verify nonces
- $this->verifyNonce($request, 'wp_rest');
+ $this->verifyNonce($request);
if ($this->action!=='') {
$this->verifyNonce($request, $this->action . $user_id, $request->get_header('action_nonce'));
}
@@ -925,7 +925,7 @@
$context,
'info'
);
- } catch (\Exception $e) {
+ } catch (Exception $e) {
// Fallback to error_log if handler fails
error_log("Security Audit: {$event} - " . json_encode($context));
}
--
Gitblit v1.10.0