File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 6
6
use PHPStan \Analyser \Scope ;
7
7
use PHPStan \Rules \Rule ;
8
8
use PHPStan \Rules \RuleErrorBuilder ;
9
- use PHPStan \Type \NullType ;
10
9
use PHPStan \Type \VerbosityLevel ;
11
10
use function sprintf ;
12
11
@@ -23,13 +22,8 @@ public function getNodeType(): string
23
22
24
23
public function processNode (Node $ node , Scope $ scope ): array
25
24
{
26
- $ nullType = new NullType ();
27
25
$ 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 ()) {
33
27
return [];
34
28
}
35
29
Original file line number Diff line number Diff line change 6
6
use PHPStan \Analyser \Scope ;
7
7
use PHPStan \Rules \Rule ;
8
8
use PHPStan \Rules \RuleErrorBuilder ;
9
- use PHPStan \Type \NullType ;
10
9
use PHPStan \Type \VerbosityLevel ;
11
10
use function sprintf ;
12
11
@@ -27,13 +26,8 @@ public function getNodeType(): string
27
26
28
27
public function processNode (Node $ node , Scope $ scope ): array
29
28
{
30
- $ nullType = new NullType ();
31
29
$ 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 ()) {
37
31
return [];
38
32
}
39
33
You can’t perform that action at this time.
0 commit comments