From 5b50afdcafd150186ea5c7b0e1cad98065590b35 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 28 Aug 2026 18:44:28 +0000
Subject: [PATCH] =A few more phpStorm suggestions, mainly in PHPDocs
---
inc/helpers/time.php | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/inc/helpers/time.php b/inc/helpers/time.php
index 0f9e44b..990026b 100644
--- a/inc/helpers/time.php
+++ b/inc/helpers/time.php
@@ -26,6 +26,7 @@
* Format a date in relative time (e.g., "2 days ago")
* @param string $dateStr - Date string or DateTime object
* @return string - Formatted relative time
+ * @throws DateMalformedStringException
*/
function jvbFormatTimeAgo(string $dateStr):string
{
@@ -311,9 +312,11 @@
/**
* Check if business is currently open based on stored hours
*
- * @param array $hours_data Array of hours data from wp_option
+ * @param array|null $hours_data Array of hours data from wp_option
* @param string $timezone Timezone string (default: 'America/Edmonton')
* @return bool True if currently open, false if closed
+ * @throws DateInvalidTimeZoneException
+ * @throws DateMalformedStringException
*/
function jvbIsCurrentlyOpen(?array $hours_data = null, string $timezone = 'America/Edmonton'):bool
{
@@ -368,6 +371,8 @@
* @param ?string $end_time End time in H:i format (e.g., '15:15')
* @param string $timezone Timezone string (default: 'America/Edmonton')
* @return bool True if current time is within range, false otherwise
+ * @throws DateInvalidTimeZoneException
+ * @throws DateMalformedStringException
*/
function jvbIsTimeBetween(?string $start_time = null, ?string $end_time = null, string $timezone = 'America/Edmonton'):bool {
if (!$start_time && !$end_time) {
@@ -401,6 +406,7 @@
* @param string $timezone Timezone string
* @return string Next opening time description or empty string if never opens
* @throws DateInvalidTimeZoneException
+ * @throws DateMalformedStringException
*/
function jvbGetNextOpeningTime(array $hours_data, string $timezone = 'America/Edmonton'):string {
if (!jvbHasOperatingHours($hours_data)) {
--
Gitblit v1.10.0