diff --git a/src/Drafter/Handlers/ModelHandler.php b/src/Drafter/Handlers/ModelHandler.php index ab035ba..371381f 100644 --- a/src/Drafter/Handlers/ModelHandler.php +++ b/src/Drafter/Handlers/ModelHandler.php @@ -144,12 +144,15 @@ protected function getModels(): array { continue; } - + // Get files under this namespace's "/Models" path foreach ($locator->listNamespaceFiles($namespace, '/Models/') as $file) { - // Load the file - require_once $file; + if (is_file($file) && pathinfo($file, PATHINFO_EXTENSION) == 'php') + { + // Load the file + require_once $file; + } } }