Tests with type resolver v2

This commit is contained in:
Jaapio
2025-12-22 23:04:25 +01:00
parent d075d95973
commit 97db20d534
6 changed files with 306 additions and 234 deletions
@@ -335,7 +335,7 @@ DOC;
),
new Param(
'args',
new Compound([new Array_(new Mixed_()), new String_()]),
new Compound([new Array_(), new String_()]),
false,
new Description(
'{' . "\n" .
@@ -356,7 +356,7 @@ DOC;
)
),
new Return_(
new Compound([new Array_(new Mixed_()), new Object_(new Fqsen('\WP_Error'))]),
new Compound([new Array_(), new Object_(new Fqsen('\WP_Error'))]),
new Description('The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.')
),
],
@@ -407,7 +407,7 @@ identifier has already been registered.',
new Since('6.5.0', new Description('')),
new Param(
'deps',
new Array_(new Mixed_()),
new Array_(),
false,
new Description("{
Optional. List of dependencies.
+5 -5
View File
@@ -16,7 +16,7 @@ use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\Array_;
use phpDocumentor\Reflection\Types\Callable_;
use phpDocumentor\Reflection\Types\CallableParameter;
use phpDocumentor\Reflection\Types\Collection;
use phpDocumentor\Reflection\PseudoTypes\Generic;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\Nullable;
use phpDocumentor\Reflection\Types\Object_;
@@ -160,19 +160,19 @@ DOCBLOCK;
],
[
'Collection<int, string>',
new Collection(new Fqsen('\\Collection'), new String_(), new Integer()),
new Generic(new Fqsen('\\Collection'), [new Integer(), new String_()]),
],
[
'Collection<TKey, Tvalue>',
new Collection(new Fqsen('\\Collection'), new Object_(new Fqsen('\\Tvalue')), new Object_(new Fqsen('\\TKey'))),
new Generic(new Fqsen('\\Collection'), [new Object_(new Fqsen('\\TKey')), new Object_(new Fqsen('\\Tvalue'))]),
],
[
'Collection<Tvalue>',
new Collection(new Fqsen('\\Collection'), new Object_(new Fqsen('\\Tvalue'))),
new Generic(new Fqsen('\\Collection'), [new Object_(new Fqsen('\\Tvalue'))]),
],
[
'callable(int $foo, string $bar): void',
new Callable_([new CallableParameter(new Integer(), 'foo'), new CallableParameter(new String_(), 'bar')], new Void_()),
new Callable_('callable', [new CallableParameter(new Integer(), 'foo'), new CallableParameter(new String_(), 'bar')], new Void_()),
],
];
}