Skip to content

Commit c236cdd

Browse files
committed
FIX exception when parsing a closure route.
1 parent 1ddb5d4 commit c236cdd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Swagger yaml generator",
44
"keywords": ["api", "swagger", "open auth"],
55
"license": "MIT",
6-
"version": "1.5.2",
6+
"version": "1.5.3",
77
"authors": [
88
{
99
"name": "Digit",
@@ -12,7 +12,7 @@
1212
],
1313
"require": {
1414
"php": "^8.0",
15-
"laravel/framework": "^7.30.6||^8.75||^9.1.9||^10.0||^11.0||^12.0",
15+
"laravel/framework": "^7.30.6|^8.75|^9.1.9|^10.0|^11.0|^12.0",
1616
"symfony/yaml": "^6.1",
1717
"phpdocumentor/reflection-docblock": "^4.3|^5.0",
1818
"doctrine/annotations": "^1.6"

src/Parser/WithAnnotationReader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ protected function methodAnnotations($ref, ?string $name = null): array
178178
if (is_array($ref)) {
179179
$ref = $this->reflectionMethod(...$ref);
180180
}
181+
if (! $ref instanceof \ReflectionMethod) {
182+
return [];
183+
}
181184
if (($annotations = $this->getCachedAnnotations($ref)) === null) {
182185
$annotations = $this->annotationReader()->getMethodAnnotations($ref);
183186
$this->setCachedAnnotations($ref, $annotations);

0 commit comments

Comments
 (0)