Skip to content

Commit b15cf90

Browse files
committed
move test
1 parent f99e3b3 commit b15cf90

2 files changed

Lines changed: 26 additions & 25 deletions

File tree

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,3 @@ public static function maybeThrows8(int $s): void
113113
}
114114
}
115115
}
116-
117-
/**
118-
* @param array<string>|null $reasons
119-
* @throws \Exception
120-
*/
121-
function check1(array &$reasons = null): void {
122-
$fileName = time() % 2 ? "abc":null;
123-
if (!$fileName) {
124-
$reasons[] = sprintf("Dependency check fail");
125-
throw new \Exception("check failed");
126-
}
127-
}
128-
129-
function test1():void {
130-
try {
131-
check1($reasons);
132-
printf("ok\n");
133-
} catch (\Exception $e) {
134-
if (!empty($reasons)) {
135-
$e = new \Exception("Dependency check failed: " . implode(', ', $reasons), 0, $e);
136-
}
137-
throw new \Exception("Failed", 0, $e);
138-
}
139-
}

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Bug7806;
44

5-
class Test {
5+
class TestMethod {
66
/**
77
* @param array<string>|null $reasons
88
* @throws \Exception
@@ -27,3 +27,28 @@ function test():void {
2727
}
2828
}
2929
}
30+
31+
/**
32+
* @param array<string>|null $reasons
33+
* @throws \Exception
34+
*/
35+
function check1(array &$reasons = null): void {
36+
$fileName = time() % 2 ? "abc":null;
37+
if (!$fileName) {
38+
$reasons[] = sprintf("Dependency check fail");
39+
throw new \Exception("check failed");
40+
}
41+
}
42+
43+
function test1():void {
44+
try {
45+
check1($reasons);
46+
printf("ok\n");
47+
} catch (\Exception $e) {
48+
if (!empty($reasons)) {
49+
$e = new \Exception("Dependency check failed: " . implode(', ', $reasons), 0, $e);
50+
}
51+
throw new \Exception("Failed", 0, $e);
52+
}
53+
}
54+

0 commit comments

Comments
 (0)