Skip to content

Commit 80a1575

Browse files
committed
Minor correction
1 parent b2a4f7c commit 80a1575

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Annotations/AnnotationGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,8 @@ protected function determineResponses(array $rules, string $plugin, string $meth
367367
// Try to determine the success response using the return type and/or doc-block return type
368368
$returnType = $reflectionMethod->getReturnType();
369369
$responseInfo = $this->getResponseInfoFromDocBlock($reflectionMethod->getDocComment());
370-
$commentType = $responseInfo['type'];
371370
if (!empty($returnType) && $returnType->isBuiltin()) {
372-
$responseInfo['type'] = $this->getOpenApiTypeFromPhpType($returnType->getName());
371+
$responseInfo['type'] = $this->getOpenApiTypeFromPhpType(strval($returnType));
373372
}
374373

375374
$successRef = null;
@@ -383,7 +382,7 @@ protected function determineResponses(array $rules, string $plugin, string $meth
383382
}
384383

385384
// If the return type is void, use the generic response type
386-
if (empty($successArray['ref']) && !empty($returnType) && $returnType->getName() === 'void') {
385+
if (empty($successArray['ref']) && !empty($returnType) && strval($returnType) === 'void') {
387386
$successArray['ref'] = '#/components/responses/GenericSuccessNoBody';
388387
}
389388

0 commit comments

Comments
 (0)