Commit 6d01a03
committed
minor #57610 [PsrHttpMessageBridge] Remove a redundant check in HttpFoundationFactory class (seriquynh)
This PR was merged into the 7.2 branch.
Discussion
----------
[PsrHttpMessageBridge] Remove a redundant check in HttpFoundationFactory class
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | N/A
| License | MIT
`HttpFoundationFactory::createRequest` method receives an implementation of `ServerRequestInterface` and it's `getUri` method must always return a `UriInterface` implementation. So, this check below is redundant.
```php
<?php
$uri = $psrRequest->getUri(); // absolutely is \Psr\Http\Message\UriInterface
if ($uri instanceof UriInterface) { // redundant check
// Do something
}
```
### My Concern
I've checked Symfony roadmap/releases [here](https://symfony.com/releases). And I decided to create a PR to branch 6.4 because:
- PsrHttpMessage is included in v6.4 (not in 5.4).
- v6.4 is still maintained (v6.0, v6.1, v6.2 and v6.3 are "End of life" versions).
- It is not a breaking/major change.
Did I choose branch correctly? If not, please give me more references/posts about how to choose a right branch for a PR.
Commits
-------
8e7e208149 Remove redundant check1 file changed
+9
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
48 | 46 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
52 | 50 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 51 | + | |
| 52 | + | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
| |||
0 commit comments