Skip to content

Commit 8ad3753

Browse files
committed
Add the TypeNode property to Mixed_
1 parent 431c02d commit 8ad3753

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/TypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function (TypeNode $nestedType) use ($context): Type {
353353
case ConditionalTypeForParameterNode::class:
354354
case OffsetAccessTypeNode::class:
355355
default:
356-
return new Mixed_();
356+
return new Mixed_($type);
357357
}
358358
}
359359

src/Types/Mixed_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace phpDocumentor\Reflection\Types;
1515

1616
use phpDocumentor\Reflection\Type;
17+
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
1718

1819
/**
1920
* Value Object representing an unknown, or mixed, type.
@@ -22,6 +23,14 @@
2223
*/
2324
final class Mixed_ implements Type
2425
{
26+
/** @var TypeNode|null */
27+
public $typeNode;
28+
29+
public function __construct(?TypeNode $typeNode = null)
30+
{
31+
$this->typeNode = $typeNode;
32+
}
33+
2534
/**
2635
* Returns a rendered output of the Type as it would be used in a DocBlock.
2736
*/

0 commit comments

Comments
 (0)