3
3
namespace PHPStan \Node \Printer ;
4
4
5
5
use PhpParser \PrettyPrinter \Standard ;
6
+ use PHPStan \Node \Expr \GetIterableKeyTypeExpr ;
7
+ use PHPStan \Node \Expr \GetIterableValueTypeExpr ;
8
+ use PHPStan \Node \Expr \GetOffsetValueTypeExpr ;
9
+ use PHPStan \Node \Expr \OriginalPropertyTypeExpr ;
10
+ use PHPStan \Node \Expr \SetOffsetValueTypeExpr ;
6
11
use PHPStan \Node \Expr \TypeExpr ;
7
12
use PHPStan \Type \VerbosityLevel ;
8
13
use function sprintf ;
@@ -15,4 +20,29 @@ protected function pPHPStan_Node_TypeExpr(TypeExpr $expr): string // phpcs:ignor
15
20
return sprintf ('__phpstanType(%s) ' , $ expr ->getExprType ()->describe (VerbosityLevel::precise ()));
16
21
}
17
22
23
+ protected function pPHPStan_Node_GetOffsetValueTypeExpr (GetOffsetValueTypeExpr $ expr ): string // phpcs:ignore
24
+ {
25
+ return sprintf ('__phpstanGetOffsetValueType(%s, %s) ' , $ this ->p ($ expr ->getVar ()), $ this ->p ($ expr ->getDim ()));
26
+ }
27
+
28
+ protected function pPHPStan_Node_GetIterableValueTypeExpr (GetIterableValueTypeExpr $ expr ): string // phpcs:ignore
29
+ {
30
+ return sprintf ('__phpstanGetIterableValueType(%s) ' , $ this ->p ($ expr ->getExpr ()));
31
+ }
32
+
33
+ protected function pPHPStan_Node_GetIterableKeyTypeExpr (GetIterableKeyTypeExpr $ expr ): string // phpcs:ignore
34
+ {
35
+ return sprintf ('__phpstanGetIterableKeyType(%s) ' , $ this ->p ($ expr ->getExpr ()));
36
+ }
37
+
38
+ protected function pPHPStan_Node_OriginalPropertyTypeExpr (OriginalPropertyTypeExpr $ expr ): string // phpcs:ignore
39
+ {
40
+ return sprintf ('__phpstanOriginalPropertyType(%s) ' , $ this ->p ($ expr ->getPropertyFetch ()));
41
+ }
42
+
43
+ protected function pPHPStan_Node_SetOffsetValueTypeExpr (SetOffsetValueTypeExpr $ expr ): string // phpcs:ignore
44
+ {
45
+ return sprintf ('__phpstanSetOffsetValueType(%s, %s, %s) ' , $ this ->p ($ expr ->getVar ()), $ expr ->getDim () !== null ? $ this ->p ($ expr ->getDim ()) : 'null ' , $ this ->p ($ expr ->getValue ()));
46
+ }
47
+
18
48
}
0 commit comments