We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e8ab9c commit 25f307fCopy full SHA for 25f307f
tests/PHPStan/Analyser/nsrt/throw-points/php8/null-safe-method-call.php
@@ -48,15 +48,19 @@ function () {
48
}
49
};
50
51
+/**
52
+ * @return object
53
+ * @throws void
54
+ */
55
+function notNullableDoesntThrow(...$args)
56
+{
57
+}
58
+
59
function () {
- $result = doesntThrow();
- if ($result === null) {
- return;
- }
- // $result is mixed~null, so ?-> never short-circuits
60
try {
- $result?->{$foo = 1}($bar = 2);
61
+ notNullableDoesntThrow()?->{$foo = 1}($bar = 2);
62
} finally {
63
+ // doesntThrow() does not return null, so ?-> will not short-circuit
64
assertVariableCertainty(TrinaryLogic::createYes(), $foo);
65
assertVariableCertainty(TrinaryLogic::createYes(), $bar);
66
0 commit comments