We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96e1289 commit 3b797d3Copy full SHA for 3b797d3
composer.json
@@ -28,6 +28,7 @@
28
"Typhoon\\Type\\": "src/"
29
},
30
"files": [
31
+ "src/dereferenceType.php",
32
"src/types.php"
33
]
34
src/dereferenceType.php
@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+namespace Typhoon\Type;
6
7
+use Typhoon\Type\Visitor\RecursiveTypeReplacer;
8
9
+/**
10
+ * @api
11
+ */
12
+function dereferenceType(Type $type): Type
13
+{
14
+ /** @var ?RecursiveTypeReplacer */
15
+ static $dereferencer = null;
16
+ $dereferencer ??= new class extends RecursiveTypeReplacer {};
17
18
+ return $type->accept($dereferencer);
19
+}
0 commit comments