From 2c2e038bdf40e489b11b510a282b33161569d336 Mon Sep 17 00:00:00 2001 From: Dustin4444 <126348160+Dustin4444@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:15:36 -0500 Subject: [PATCH] Fix warning in DisqusResource->__call() method Add a check to ensure `$args` has an element at index 0 before accessing it in the `__call` method of the `DisqusResource` class. * Modify line 78 in `disqusapi/disqusapi.php` to check if `$args` has an element at index 0 before accessing it. --- disqusapi/disqusapi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disqusapi/disqusapi.php b/disqusapi/disqusapi.php index 00ff7eb..97d5dce 100644 --- a/disqusapi/disqusapi.php +++ b/disqusapi/disqusapi.php @@ -75,7 +75,7 @@ public function __call($name, $args) { if (!$resource) { throw new DisqusInterfaceNotDefined(); } - $kwargs = (array)$args[0]; + $kwargs = isset($args[0]) ? (array)$args[0] : array(); foreach ((array)$resource->required as $k) { if (empty($kwargs[$k])) { @@ -147,4 +147,4 @@ public function setFormat($format) { public function setVersion($version) { $this->version = $version; } -} \ No newline at end of file +}