We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91f823b commit 528fa76Copy full SHA for 528fa76
1 file changed
tests/PHPStan/Analyser/nsrt/pr-5447.php
@@ -0,0 +1,37 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+namespace PR5447Regression;
6
7
+use function PHPStan\Testing\assertType;
8
9
+class Foo
10
+{
11
12
+ public function doFoo(): void
13
+ {
14
+ $device = $this->nullable();
15
+ if ($device === null) {
16
+ $device = 1;
17
+ try {
18
+ $device = $this->throwsException();
19
+ } catch (\Exception) {
20
21
+ assertType('int|null', $device);
22
+ }
23
24
25
26
+ public function nullable(): ?int
27
28
29
30
31
+ /** @throws \Exception */
32
+ private function throwsException(): int
33
34
35
36
37
+}
0 commit comments