22
33namespace PHPStan \Analyser ;
44
5- use PHPStan \ Type \ Type ;
5+ use PhpParser \ Node \ Expr ;
66
77final class ExpressionContext
88{
99
1010 private function __construct (
1111 private bool $ isDeep ,
1212 private ?string $ inAssignRightSideVariableName ,
13- private ?Type $ inAssignRightSideType ,
14- private ?Type $ inAssignRightSideNativeType ,
13+ private ?Expr $ inAssignRightSideExpr ,
1514 )
1615 {
1716 }
1817
1918 public static function createTopLevel (): self
2019 {
21- return new self (false , null , null , null );
20+ return new self (false , null , null );
2221 }
2322
2423 public static function createDeep (): self
2524 {
26- return new self (true , null , null , null );
25+ return new self (true , null , null );
2726 }
2827
2928 public function enterDeep (): self
@@ -32,32 +31,27 @@ public function enterDeep(): self
3231 return $ this ;
3332 }
3433
35- return new self (true , $ this ->inAssignRightSideVariableName , $ this ->inAssignRightSideType , $ this -> inAssignRightSideNativeType );
34+ return new self (true , $ this ->inAssignRightSideVariableName , $ this ->inAssignRightSideExpr );
3635 }
3736
3837 public function isDeep (): bool
3938 {
4039 return $ this ->isDeep ;
4140 }
4241
43- public function enterRightSideAssign (string $ variableName , Type $ type , Type $ nativeType ): self
42+ public function enterRightSideAssign (string $ variableName , Expr $ expr ): self
4443 {
45- return new self ($ this ->isDeep , $ variableName , $ type , $ nativeType );
44+ return new self ($ this ->isDeep , $ variableName , $ expr );
4645 }
4746
4847 public function getInAssignRightSideVariableName (): ?string
4948 {
5049 return $ this ->inAssignRightSideVariableName ;
5150 }
5251
53- public function getInAssignRightSideType (): ?Type
52+ public function getInAssignRightSideExpr (): ?Expr
5453 {
55- return $ this ->inAssignRightSideType ;
56- }
57-
58- public function getInAssignRightSideNativeType (): ?Type
59- {
60- return $ this ->inAssignRightSideNativeType ;
54+ return $ this ->inAssignRightSideExpr ;
6155 }
6256
6357}
0 commit comments