From 0132ad7db48c1f2e126a7a088ac9af91667c2133 Mon Sep 17 00:00:00 2001 From: "Bruno O. Notario" Date: Sun, 17 Apr 2022 01:46:39 -0300 Subject: [PATCH] Bugfix bad use array_search instead in_array... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🫣 --- system/engine/restful.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/engine/restful.php b/system/engine/restful.php index 9190d33..ed2e5be 100644 --- a/system/engine/restful.php +++ b/system/engine/restful.php @@ -66,7 +66,7 @@ class RESTful extends Controller { function index() { $method = (Request::METHOD()); - if (array_search($method, $this->HTTPMETHODS) && is_callable(array($this, $method))) { + if (in_array($method, $this->HTTPMETHODS) && is_callable(array($this, $method))) { $r = new ReflectionMethod($this, $method); $params = []; /* $requiredParamsTotal = $r->getNumberOfRequiredParameters(); @@ -110,7 +110,7 @@ class RESTful extends Controller { if($data !== null && $phpDocParams && isset($phpDocParams['param']) && is_array($phpDocParams['param'])){ $type = (isset($phpDocParams['param']['$'.$value->getName()])) ? $phpDocParams['param']['$' . $value->getName()]['type']: false; if($type){ - if((is_array($type) && !array_search(gettype($data), $type)) || (gettype($data) != $type)){ + if((is_array($type) && !in_array(gettype($data), $type)) || (gettype($data) != $type)){ $invalidDataType = true; if(is_array($type)){