From 77ce6592637e57f5a244f176ca4dc5515d9def02 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Mon, 27 Nov 2017 14:42:07 +0100 Subject: [PATCH] Valid argument fix --- src/Rossedman/Teamwork/AbstractObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rossedman/Teamwork/AbstractObject.php b/src/Rossedman/Teamwork/AbstractObject.php index d4bde1e..ef53682 100644 --- a/src/Rossedman/Teamwork/AbstractObject.php +++ b/src/Rossedman/Teamwork/AbstractObject.php @@ -56,8 +56,8 @@ protected function areArgumentsValid($args, array $accepted) return; } - foreach ($args as $arg) { - if (! array_key_exists($arg, $accepted)) { + foreach ($args as $arg => $value) { + if (! in_array($arg, $accepted)) { throw new \InvalidArgumentException('This call only accepts these arguments: ' . implode(" | ",$accepted)); } }