File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66use PHPStan \Analyser \Scope ;
77use PHPStan \Rules \Rule ;
88use PHPStan \Rules \RuleErrorBuilder ;
9- use PHPStan \Type \NullType ;
109use PHPStan \Type \VerbosityLevel ;
1110use function sprintf ;
1211
@@ -23,13 +22,8 @@ public function getNodeType(): string
2322
2423 public function processNode (Node $ node , Scope $ scope ): array
2524 {
26- $ nullType = new NullType ();
2725 $ calledOnType = $ scope ->getType ($ node ->var );
28- if ($ calledOnType ->equals ($ nullType )) {
29- return [];
30- }
31-
32- if (!$ calledOnType ->isSuperTypeOf ($ nullType )->no ()) {
26+ if (!$ calledOnType ->isNull ()->no ()) {
3327 return [];
3428 }
3529
Original file line number Diff line number Diff line change 66use PHPStan \Analyser \Scope ;
77use PHPStan \Rules \Rule ;
88use PHPStan \Rules \RuleErrorBuilder ;
9- use PHPStan \Type \NullType ;
109use PHPStan \Type \VerbosityLevel ;
1110use function sprintf ;
1211
@@ -27,13 +26,8 @@ public function getNodeType(): string
2726
2827 public function processNode (Node $ node , Scope $ scope ): array
2928 {
30- $ nullType = new NullType ();
3129 $ calledOnType = $ scope ->getType ($ node ->var );
32- if ($ calledOnType ->equals ($ nullType )) {
33- return [];
34- }
35-
36- if (!$ calledOnType ->isSuperTypeOf ($ nullType )->no ()) {
30+ if (!$ calledOnType ->isNull ()->no ()) {
3731 return [];
3832 }
3933
You can’t perform that action at this time.
0 commit comments