Skip to content

Commit 5370a94

Browse files
committed
Switched from ParameterType to ParameterClass to allow PHP5 compatibility
1 parent 6234d61 commit 5370a94

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: php
22

33
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
47
- 7.0
58

69
before_script:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.0.0",
14+
"php": ">=5.4.0",
1515
"laravel/framework": "~5.0",
1616
"phpdocumentor/reflection-docblock": "~2.0",
1717
"mpociot/documentarian": "^0.2.0",

src/Mpociot/ApiDoc/ApiDocGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ private function getRouteRules($route)
9292
$reflectionMethod = $reflection->getMethod($method);
9393

9494
foreach ($reflectionMethod->getParameters() as $parameter) {
95-
$parameterType = $parameter->getType();
96-
if (!is_null($parameterType) && class_exists($parameterType)) {
97-
$className = $parameterType->__toString();
95+
$parameterType = $parameter->getClass();
96+
if (!is_null($parameterType) && class_exists($parameterType->name)) {
97+
$className = $parameterType->name;
9898
$parameterReflection = new $className;
9999
if ($parameterReflection instanceof FormRequest) {
100100
if (method_exists($parameterReflection, 'validator')) {

0 commit comments

Comments
 (0)