Skip to content

Commit a406f2d

Browse files
committed
[HttpFoundation] Add $flush parameter to Response::send()
1 parent 68d172b commit a406f2d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.4
5+
---
6+
7+
* Add argument `bool $debug = false` to `HttpKernelRunner::__construct()`
8+
49
5.4
510
---
611

Runner/Symfony/HttpKernelRunner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ class HttpKernelRunner implements RunnerInterface
2424
public function __construct(
2525
private readonly HttpKernelInterface $kernel,
2626
private readonly Request $request,
27+
private readonly bool $debug = false,
2728
) {
2829
}
2930

3031
public function run(): int
3132
{
3233
$response = $this->kernel->handle($this->request);
33-
$response->send();
34+
$response->send(!$this->debug);
3435

3536
if ($this->kernel instanceof TerminableInterface) {
3637
$this->kernel->terminate($this->request, $response);

SymfonyRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function __construct(array $options = [])
131131
public function getRunner(?object $application): RunnerInterface
132132
{
133133
if ($application instanceof HttpKernelInterface) {
134-
return new HttpKernelRunner($application, Request::createFromGlobals());
134+
return new HttpKernelRunner($application, Request::createFromGlobals(), $this->options['debug'] ?? false);
135135
}
136136

137137
if ($application instanceof Response) {

0 commit comments

Comments
 (0)