Add default types to method tag arguments

This commit is contained in:
Jaapio
2022-10-28 22:37:28 +02:00
parent e4ac07bc40
commit 81553b535f
3 changed files with 28 additions and 1 deletions
@@ -18,6 +18,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Method;
use phpDocumentor\Reflection\DocBlock\Tags\MethodParameter;
use phpDocumentor\Reflection\Types\Context;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\Mixed_;
use phpDocumentor\Reflection\Types\String_;
use phpDocumentor\Reflection\Types\Void_;
@@ -82,6 +83,30 @@ final class MethodFactoryTest extends TagFactoryTestCase
[]
),
],
[
'@method myMethod($a)',
new Method(
'myMethod',
[],
new Void_(),
false,
new Description(''),
false,
[new MethodParameter('a', new Mixed_())]
),
],
[
'@method myMethod($a = 1)',
new Method(
'myMethod',
[],
new Void_(),
false,
new Description(''),
false,
[new MethodParameter('a', new Mixed_(), false, false, '1')]
),
],
[
'@method myMethod(int $a = 1)',
new Method(