Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.4.0] did not work #472

Closed
usknot opened this issue Mar 11, 2019 · 3 comments
Closed

[3.4.0] did not work #472

usknot opened this issue Mar 11, 2019 · 3 comments

Comments

@usknot
Copy link

usknot commented Mar 11, 2019

hello.
This pull request was merged, but it did not work. It seems that it does not work well in the argument part of the controller, what should I do?

#460

Controller

public function exsample(string $version, Request $request)
{
}

error

ReflectionException  : Class string does not exist

mpociot/laravel-apidoc-generator/src/Tools/Generator.php:90
    86| 
    87|     $parameterClassName = version_compare(phpversion(), '7.1.0', '<')
    88|         ? $paramType->__toString()
    89|         : $paramType->getName();
  > 90|     $parameterClass = new ReflectionClass($parameterClassName);
    91|     if (class_exists('\Illuminate\Foundation\Http\FormRequest') && $parameterClass->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class)) {
    92|         $formRequestDocBlock = new DocBlock($parameterClass->getDocComment());
    93|         $bodyParametersFromDocBlock = $this->getBodyParametersFromDocBlock($formRequestDocBlock->getTags());
@usknot
Copy link
Author

usknot commented Mar 11, 2019

fix it to use try catch?

try {
    $parameterClass = new ReflectionClass($parameterClassName);
} catch (\ReflectionException $e) {
    continue;
}

@usknot
Copy link
Author

usknot commented Mar 11, 2019

I created a pull request on this subject. Please approve it when there is no problem.

#474

@shalvah
Copy link
Contributor

shalvah commented Mar 13, 2019

Fixed in 3.4.3

@shalvah shalvah closed this as completed Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants