Skip to content

Commit f5f784b

Browse files
author
Jeremiah VALERIE
committed
Merge branch '0.12' into 0.13
2 parents c6107c3 + aa0d706 commit f5f784b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Config/Parser/AnnotationParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,11 @@ private static function getDescriptionConfiguration(array $annotations, bool $wi
750750
private static function getArgs(array $args = null, \ReflectionMethod $method = null): array
751751
{
752752
$config = [];
753-
if ($args && !empty($args)) {
753+
if (!empty($args)) {
754754
foreach ($args as $arg) {
755755
$config[$arg->name] = ['type' => $arg->type]
756-
+ ($arg->description ? ['description' => $arg->description] : [])
757-
+ ($arg->default ? ['defaultValue' => $arg->default] : []);
756+
+ (null !== $arg->description ? ['description' => $arg->description] : [])
757+
+ (null !== $arg->default ? ['defaultValue' => $arg->default] : []);
758758
}
759759
} elseif ($method) {
760760
$config = self::guessArgs($method);

tests/Config/Parser/AnnotationParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testTypes(): void
119119
'currentMaster' => ['type' => 'Sith', 'resolve' => "@=service('master_resolver').getMaster(value)"],
120120
'victims' => [
121121
'type' => '[Character]',
122-
'args' => ['jediOnly' => ['type' => 'Boolean', 'description' => 'Only Jedi victims']],
122+
'args' => ['jediOnly' => ['type' => 'Boolean', 'description' => 'Only Jedi victims', 'defaultValue' => false]],
123123
'resolve' => '@=call(value.getVictims, arguments({jediOnly: "Boolean"}, args))',
124124
],
125125
],

0 commit comments

Comments
 (0)