From fb7c56e97a243ed75ca1109e9a010a2edcbee2fc Mon Sep 17 00:00:00 2001 From: Vic <80332034+vic-onfleet@users.noreply.github.com> Date: Fri, 26 May 2023 11:09:36 +0300 Subject: [PATCH 1/2] Update Methods.php Added a fix for the warning --- src/Methods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Methods.php b/src/Methods.php index 758644f..3752549 100644 --- a/src/Methods.php +++ b/src/Methods.php @@ -78,7 +78,7 @@ public static function method(array $methodData, Onfleet $api, ...$args) if (count($args) >= 1 && in_array($method, ['GET', 'DELETE', 'PUT'])) { // If the 2nd argument is part of this array, this is a new endpoint // This covers get(id, params) and insertTask(id, params) - if (in_array($args[1], ['name', 'shortId', 'phone', 'workers', 'organizations', 'teams'])) { + if (isset($args[1]) in_array($args[1], ['name', 'shortId', 'phone', 'workers', 'organizations', 'teams'])) { $url = self::replaceWithEndpointAndParam($url, $args[1], $args[0]); // If the 1st argument is a base 64 encoded ID, replaces URL path with ID // This covers get(id), update(id), and deleteOne(id) From 88d8e08f817937bd0444155c39be0a49f402101d Mon Sep 17 00:00:00 2001 From: Vic <80332034+vic-onfleet@users.noreply.github.com> Date: Fri, 26 May 2023 11:14:54 +0300 Subject: [PATCH 2/2] Update Methods.php --- src/Methods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Methods.php b/src/Methods.php index 3752549..0a866c8 100644 --- a/src/Methods.php +++ b/src/Methods.php @@ -78,7 +78,7 @@ public static function method(array $methodData, Onfleet $api, ...$args) if (count($args) >= 1 && in_array($method, ['GET', 'DELETE', 'PUT'])) { // If the 2nd argument is part of this array, this is a new endpoint // This covers get(id, params) and insertTask(id, params) - if (isset($args[1]) in_array($args[1], ['name', 'shortId', 'phone', 'workers', 'organizations', 'teams'])) { + if (isset($args[1]) && in_array($args[1], ['name', 'shortId', 'phone', 'workers', 'organizations', 'teams'])) { $url = self::replaceWithEndpointAndParam($url, $args[1], $args[0]); // If the 1st argument is a base 64 encoded ID, replaces URL path with ID // This covers get(id), update(id), and deleteOne(id)