From f53de0a61e11a88626da4d4935a65f2eee23e80c Mon Sep 17 00:00:00 2001 From: Halil Beycan Date: Wed, 8 Dec 2021 22:23:04 +0300 Subject: [PATCH] If parameters are sent as an array. To avoid problems. --- src/Contract.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Contract.php b/src/Contract.php index 87ad1fc..25843f4 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -587,6 +587,8 @@ class Contract $method = array_splice($arguments, 0, 1)[0]; $callback = array_pop($arguments); + $arguments = is_array($arguments[0]) ? $arguments[0] : $arguments; + if (!is_string($method)) { throw new InvalidArgumentException('Please make sure the method is string.'); }