Skip to content

Commit ba227b2

Browse files
authored
Merge f78a5d5 into a223567
2 parents a223567 + f78a5d5 commit ba227b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Config/Parser/MetadataParser/MetadataParser.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,22 +556,22 @@ private static function getTypeFieldConfigurationFromReflector(ReflectionClass $
556556
/** @var Metadata\Arg[] $argAnnotations */
557557
$argAnnotations = self::getMetadataMatching($metadatas, Metadata\Arg::class);
558558

559+
if ($reflector instanceof ReflectionMethod) {
560+
$args = self::guessArgs($reflectionClass, $reflector);
561+
}
562+
559563
foreach ($argAnnotations as $arg) {
560-
$args[$arg->name] = ['type' => $arg->type];
564+
$args[$arg->name] ??= ['type' => $arg->type];
561565

562566
if (isset($arg->description)) {
563567
$args[$arg->name]['description'] = $arg->description;
564568
}
565569

566570
if (isset($arg->default)) {
567-
$args[$arg->name]['defaultValue'] = $arg->default;
571+
$args[$arg->name]['defaultValue'] ??= $arg->default;
568572
}
569573
}
570574

571-
if (empty($argAnnotations) && $reflector instanceof ReflectionMethod) {
572-
$args = self::guessArgs($reflectionClass, $reflector);
573-
}
574-
575575
if (!empty($args)) {
576576
$fieldConfiguration['args'] = $args;
577577
}

0 commit comments

Comments
 (0)