From 5370a9418797a75e1f72fcd458da9dae5c035dad Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Sun, 22 May 2016 20:17:15 +0200 Subject: [PATCH] Switched from ParameterType to ParameterClass to allow PHP5 compatibility --- .travis.yml | 3 +++ composer.json | 2 +- src/Mpociot/ApiDoc/ApiDocGenerator.php | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67c86a3e..cac561b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ language: php php: + - 5.4 + - 5.5 + - 5.6 - 7.0 before_script: diff --git a/composer.json b/composer.json index c98e6ea4..d0855da7 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=7.0.0", + "php": ">=5.4.0", "laravel/framework": "~5.0", "phpdocumentor/reflection-docblock": "~2.0", "mpociot/documentarian": "^0.2.0", diff --git a/src/Mpociot/ApiDoc/ApiDocGenerator.php b/src/Mpociot/ApiDoc/ApiDocGenerator.php index dd28f725..78fec644 100644 --- a/src/Mpociot/ApiDoc/ApiDocGenerator.php +++ b/src/Mpociot/ApiDoc/ApiDocGenerator.php @@ -92,9 +92,9 @@ private function getRouteRules($route) $reflectionMethod = $reflection->getMethod($method); foreach ($reflectionMethod->getParameters() as $parameter) { - $parameterType = $parameter->getType(); - if (!is_null($parameterType) && class_exists($parameterType)) { - $className = $parameterType->__toString(); + $parameterType = $parameter->getClass(); + if (!is_null($parameterType) && class_exists($parameterType->name)) { + $className = $parameterType->name; $parameterReflection = new $className; if ($parameterReflection instanceof FormRequest) { if (method_exists($parameterReflection, 'validator')) {