Commit a219d0c
committed
minor #54590 [HttpFoundation] Remove unused code (minor) (smnandre)
This PR was merged into the 7.1 branch.
Discussion
----------
[HttpFoundation] Remove unused code (minor)
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | Fix #...
| License | MIT
Remove two unused var declarations (both are declared/computed just after) (in green in the following code block)
```diff
// headers
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
- $newValues = $values;
- $replace = false;
// As recommended by RFC 8297, PHP automatically copies headers from previous 103 responses, we need to deal with that if headers changed
$previousValues = $this->sentHeaders[$name] ?? null;
if ($previousValues === $values) {
// Header already sent in a previous response, it will be automatically copied in this response by PHP
continue;
}
+ $replace = 0 === strcasecmp($name, 'Content-Type');
if (null !== $previousValues && array_diff($previousValues, $values)) {
header_remove($name);
$previousValues = null;
}
+ $newValues = null === $previousValues ? $values : array_diff($values, $previousValues);
foreach ($newValues as $value) {
header($name.': '.$value, $replace, $this->statusCode);
}
```
Commits
-------
08841af1a15 [HttpFoundation] Remove unused code (minor)1 file changed
+0
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 329 | | |
333 | 330 | | |
334 | 331 | | |
| |||
0 commit comments