From e6672fe38ce5d99f3b3f026154f777aded7361de Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 29 Jan 2026 17:36:53 +0000
Subject: [PATCH] =Starting refactor of Meta and Routes to fluent-style
---
inc/integrations/GoogleMyBusiness.php | 29 ++++++++++++-----------------
1 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/inc/integrations/GoogleMyBusiness.php b/inc/integrations/GoogleMyBusiness.php
index e818d5b..2e97d01 100644
--- a/inc/integrations/GoogleMyBusiness.php
+++ b/inc/integrations/GoogleMyBusiness.php
@@ -2,7 +2,6 @@
namespace JVBase\integrations;
use JVBase\meta\MetaManager;
-use JVBase\managers\CacheManager;
use WP_Error;
if (!defined('ABSPATH')) {
exit;
@@ -129,7 +128,9 @@
]
);
-// $this->cache->clear();
+ if (JVB_TESTING) {
+ $this->cache->flush();
+ }
}
protected function initialize(): void
@@ -1737,9 +1738,7 @@
$text = preg_replace('/\s+/', ' ', $text);
// Trim
- $text = trim($text);
-
- return $text;
+ return trim($text);
}
/**
* Format date for GMB API
@@ -1780,11 +1779,10 @@
// Validate hour and minute ranges
if ($hour >= 0 && $hour <= 23 && $minute >= 0 && $minute <= 59) {
- $result = [
+ return [
'hours' => $hour,
'minutes' => $minute
];
- return $result;
}
}
@@ -2074,9 +2072,7 @@
[],
'posts'
);
- $result = $response['foodMenus'] ?? [];
-
- return $result;
+ return $response['foodMenus'] ?? [];
}
/**
@@ -2279,7 +2275,7 @@
{
try {
// Use the static method to clear the entire cache group
- $this->cache->clear();
+ $this->cache->flush();
return true;
} catch (\Exception $e) {
@@ -2351,12 +2347,11 @@
'dailyRange.endDate.day' => date('j', strtotime($end_date))
];
- $response = $this->getRequest(
- "/v1/{$location_name}:fetchMultiDailyMetricsTimeSeries?" . http_build_query($params),
- $params,
- 'performance'
- );
- return $response;
+ return $this->getRequest(
+ "/v1/{$location_name}:fetchMultiDailyMetricsTimeSeries?" . http_build_query($params),
+ $params,
+ 'performance'
+ );
}
/**
--
Gitblit v1.10.0