@@ -204,6 +204,7 @@ public function __construct(
204204private  PropertyReflectionFinder $ propertyReflectionFinder
205205private  Parser $ parser
206206private  NodeScopeResolver $ nodeScopeResolver
207+ private  RicherScopeGetTypeHelper $ richerScopeGetTypeHelper
207208private  ConstantResolver $ constantResolver
208209private  ScopeContext $ context
209210private  PhpVersion $ phpVersion
@@ -924,46 +925,11 @@ private function resolveType(string $exprString, Expr $node): Type
924925}
925926
926927if  ($ nodeinstanceof  Expr \BinaryOp \Identical) {
927- if  (
928- $ nodeleft  instanceof  Variable
929- && is_string ($ nodeleft ->name )
930- && $ noderight  instanceof  Variable
931- && is_string ($ noderight ->name )
932- && $ nodeleft ->name  === $ noderight ->name 
933- ) {
934- return  new  ConstantBooleanType (true );
935- }
936- 
937- $ leftType$ this getType ($ nodeleft );
938- $ rightType$ this getType ($ noderight );
939- 
940- if  (
941- (
942- $ nodeleft  instanceof  Node \Expr \PropertyFetch
943- || $ nodeleft  instanceof  Node \Expr \StaticPropertyFetch
944- )
945- && $ rightTypeisNull ()->yes ()
946- && !$ this hasPropertyNativeType ($ nodeleft )
947- ) {
948- return  new  BooleanType ();
949- }
950- 
951- if  (
952- (
953- $ noderight  instanceof  Node \Expr \PropertyFetch
954- || $ noderight  instanceof  Node \Expr \StaticPropertyFetch
955- )
956- && $ leftTypeisNull ()->yes ()
957- && !$ this hasPropertyNativeType ($ noderight )
958- ) {
959- return  new  BooleanType ();
960- }
961- 
962- return  $ this initializerExprTypeResolver ->resolveIdenticalType ($ leftType$ rightTypetype ;
928+ return  $ this richerScopeGetTypeHelper ->getIdenticalResult ($ this $ nodetype ;
963929}
964930
965931if  ($ nodeinstanceof  Expr \BinaryOp \NotIdentical) {
966- return  $ this getType ( new   Expr \ BooleanNot ( new   BinaryOp \ Identical ( $ node -> left , $ node-> right ))) ;
932+ return  $ this richerScopeGetTypeHelper -> getNotIdenticalResult ( $ this $ node)-> type ;
967933}
968934
969935if  ($ nodeinstanceof  Expr \Instanceof_) {
@@ -2654,7 +2620,7 @@ private function promoteNativeTypes(): self
26542620/** 
26552621 * @param Node\Expr\PropertyFetch|Node\Expr\StaticPropertyFetch $propertyFetch 
26562622 */ 
2657- private  function  hasPropertyNativeType ($ propertyFetchbool 
2623+ public  function  hasPropertyNativeType ($ propertyFetchbool 
26582624{
26592625$ propertyReflection$ this propertyReflectionFinder ->findPropertyReflectionFromNode ($ propertyFetch$ this 
26602626if  ($ propertyReflectionnull ) {
0 commit comments