From 5a5fdf5682f017c7f0fc74a7f2990b81cbb5d84f Mon Sep 17 00:00:00 2001 From: Emily Ivie Date: Thu, 1 Sep 2016 09:40:37 -0700 Subject: [PATCH] #96 - autoloader check class exists in array https://github.com/zendtech/IbmiToolkit/issues/96 --- ToolkitApi/autoload.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ToolkitApi/autoload.php b/ToolkitApi/autoload.php index 07e9b1c..3a1bd22 100644 --- a/ToolkitApi/autoload.php +++ b/ToolkitApi/autoload.php @@ -45,9 +45,11 @@ 'ToolkitApi\UInt16Param' => __DIR__ . DIRECTORY_SEPARATOR . 'UInt16Param.php', ); - $file = $classmap[$class]; - if (file_exists($file)) { - require_once $file; + if (array_key_exists($class, $classmap)) { + $file = $classmap[$class]; + if (file_exists($file)) { + require_once $file; + } } return;