Skip to content

Commit dde1b67

Browse files
committed
move test
1 parent 9ede808 commit dde1b67

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

tests/PHPStan/Rules/Variables/data/bug-12597-non-finite.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,35 @@ public function test(mixed $type): void
1717

1818
public function message(string $message): void {}
1919
}
20+
21+
class Foo {}
22+
class Bar {}
23+
24+
class HelloWorld2
25+
{
26+
public function test(mixed $type): void
27+
{
28+
if (is_int($type) || is_object($type)) {
29+
$message = 'Hello!';
30+
}
31+
32+
if (is_int($type)) {
33+
$this->message($message);
34+
}
35+
}
36+
37+
public function test2(mixed $type): void
38+
{
39+
if ($type instanceof Foo || $type instanceof Bar) {
40+
$message = 'Hello!';
41+
}
42+
43+
if ($type instanceof Foo) {
44+
$this->message($message);
45+
}
46+
}
47+
48+
public function message(string $message): void
49+
{
50+
}
51+
}

tests/PHPStan/Rules/Variables/data/bug-12597.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,3 @@ public function test(int $type): void
2020

2121
public function message(string $message): void {}
2222
}
23-
24-
class HelloWorld2
25-
{
26-
public function test(mixed $type): void
27-
{
28-
if (is_int($type) || is_object($type)) {
29-
$message = 'Hello!';
30-
}
31-
32-
if (is_int($type)) {
33-
$this->message($message);
34-
}
35-
}
36-
37-
public function test2(mixed $type): void
38-
{
39-
if ($type instanceof Foo || $type instanceof Bar) {
40-
$message = 'Hello!';
41-
}
42-
43-
if ($type instanceof Foo) {
44-
$this->message($message);
45-
}
46-
}
47-
48-
public function message(string $message): void
49-
{
50-
}
51-
}
52-

0 commit comments

Comments
 (0)