Skip to content

Commit

Permalink
Switched from ParameterType to ParameterClass to allow PHP5 compatibi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
mpociot committed May 22, 2016
1 parent 6234d61 commit 5370a94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0

before_script:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Mpociot/ApiDoc/ApiDocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 5370a94

Please sign in to comment.