diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
index b1c19e6a66..44a255000c 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
@@ -16,15 +16,15 @@
{% set request_route = collector.route ? collector.route : 'NONE' %}
{% set icon %}
- {{ collector.statuscode }}
+ {{ collector.statuscode }}
{{ request_handler }}
on {{ request_route }}
{% endset %}
{% set text %}
{% spaceless %}
- Status Code
- {{ collector.statuscode }}
+ Status
+ {{ collector.statuscode }} {{ collector.statustext }}
Controller
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
index a797e75494..d496c301e9 100644
--- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
+++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
@@ -79,11 +79,14 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
}
}
+ $statusCode = $response->getStatusCode();
+
$this->data = array(
'format' => $request->getRequestFormat(),
'content' => $content,
'content_type' => $response->headers->get('Content-Type') ? $response->headers->get('Content-Type') : 'text/html',
- 'status_code' => $response->getStatusCode(),
+ 'status_text' => isset(Response::$statusTexts[$statusCode]) ? Response::$statusTexts[$statusCode] : '',
+ 'status_code' => $statusCode,
'request_query' => $request->query->all(),
'request_request' => $request->request->all(),
'request_headers' => $request->headers->all(),
@@ -195,6 +198,11 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
return $this->data['content_type'];
}
+ public function getStatusText()
+ {
+ return $this->data['status_text'];
+ }
+
public function getStatusCode()
{
return $this->data['status_code'];
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
index 10322b132d..7e31d0626d 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
@@ -50,6 +50,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('en',$c->getLocale());
$this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag',$c->getResponseHeaders());
+ $this->assertEquals('OK',$c->getStatusText());
$this->assertEquals(200,$c->getStatusCode());
$this->assertEquals('application/json',$c->getContentType());
}