Commit 52f1436
committed
minor #58241 [HttpKernel] allow narrow type of not nullable getResponse when hasResponse has been called (shyim)
This PR was submitted for the 5.4 branch but it was squashed and merged into the 7.2 branch instead.
Discussion
----------
[HttpKernel] allow narrow type of not nullable getResponse when hasResponse has been called
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
```php
if ($event->hasResponse()) {
return $event->getResponse();
}
```
PHPStan understands now inside the if that Response is not nullable anymore
Commits
-------
69f2f48 [HttpKernel] allow narrow type of not nullable getResponse when hasResponse has been called1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
0 commit comments