File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 50
50
use PhpParser \Node \Stmt \Switch_ ;
51
51
use PhpParser \Node \VariadicPlaceholder ;
52
52
use PHPStan \Type \ObjectType ;
53
+ use PHPStan \Node \Expr \AlwaysRememberedExpr ;
53
54
use Rector \StaticTypeMapper \ValueObject \Type \FullyQualifiedObjectType ;
54
55
use Symplify \RuleDocGenerator \ValueObject \CodeSample \ConfiguredCodeSample ;
55
56
use Symplify \RuleDocGenerator \ValueObject \RuleDefinition ;
@@ -664,6 +665,9 @@ protected function refactorKey(PropertyFetch $fetch): ?Node
664
665
protected function refactorMatch (Match_ $ match ): ?Node
665
666
{
666
667
$ cond = $ match ->cond ;
668
+ while ($ cond instanceof AlwaysRememberedExpr) {
669
+ $ cond = $ cond ->getExpr ();
670
+ }
667
671
if (($ cond instanceof PropertyFetch || $ cond instanceof NullsafePropertyFetch)
668
672
&& $ this ->inConfiguredClasses ($ cond ->var )
669
673
) {
@@ -691,6 +695,7 @@ protected function refactorMatch(Match_ $match): ?Node
691
695
return new Match_ ($ var , $ match ->arms , $ match ->getAttributes ());
692
696
}
693
697
}
698
+ dump ($ this ->inConfiguredClasses ($ cond ));
694
699
695
700
if ($ this ->inConfiguredClasses ($ cond )) {
696
701
return null ;
You can’t perform that action at this time.
0 commit comments