Pārlūkot izejas kodu

[WebProfilerBundle] Revert the support for a status in data collectors

Victor Berchet 14 gadi atpakaļ
vecāks
revīzija
8128300baa

+ 0 - 6
src/Symfony/Bundle/DoctrineBundle/DataCollector/DoctrineDataCollector.php

@@ -68,10 +68,4 @@ class DoctrineDataCollector extends DataCollector
         return 'db';
     }
 
-    /**
-     * {@inheritdoc}
-     */
-    public function getStatus() {
-        return $this->getQueryCount() < 10 ? self::INFO : self::WARNING;
-    }
 }

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig

@@ -7,7 +7,7 @@
     {% set text %}
         <span title="{{ '%0.2f'|format(collector.time * 1000) }} ms">{{ collector.querycount }}</span>
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
 {% endblock %}
 
 {% block menu %}

+ 0 - 7
src/Symfony/Bundle/DoctrineMongoDBBundle/DataCollector/DoctrineMongoDBDataCollector.php

@@ -56,11 +56,4 @@ class DoctrineMongoDBDataCollector extends DataCollector
     {
         return 'mongodb';
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getStatus() {
-        return $this->getQueryCount() < 10 ? self::INFO : self::WARNING;
-    }
 }

+ 1 - 1
src/Symfony/Bundle/DoctrineMongoDBBundle/Resources/views/Collector/mongodb.html.twig

@@ -7,7 +7,7 @@
     {% set text %}
         <span>{{ collector.querycount }}</span>
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
 {% endblock %}
 
 {% block menu %}

+ 1 - 1
src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

@@ -15,7 +15,7 @@
             {% endif %}
         </span>
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
 {% endblock %}
 
 {% block menu %}

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

@@ -7,7 +7,7 @@
     {% set text %}
         <span>{{ collector.counterrors }}</span>
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
 {% endblock %}
 
 {% block menu %}

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig

@@ -7,5 +7,5 @@
     {% set text %}
         {{ '%.0f'|format(collector.memory / 1024) }} KB
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %}
 {% endblock %}

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig

@@ -13,7 +13,7 @@
         <span style="margin: 0; padding: 0; color: #979696;">|</span>
         {{ collector.contenttype }}
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
 {% endblock %}
 
 {% block menu %}

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/timer.html.twig

@@ -7,5 +7,5 @@
     {% set text %}
         {{ '%.0f'|format(collector.time * 1000) }} ms
     {% endset %}
-    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false, 'status': collector.status } %}
+    {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %}
 {% endblock %}

+ 1 - 8
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig

@@ -3,14 +3,7 @@
         <a style="text-decoration: none; margin: 0; padding: 0;" href="{{ path('_profiler', { 'token': token, 'panel': name }) }}">{{ icon }}</a>
     {% endset %}
 {% endif %}
-{% if 'info' == status|default('info') %}
-    {% set style = '' %}
-{% elseif 'warning' == status %}
-    {% set style = 'background-color: #fa2;' %}
-{% else %}
-    {% set style = 'background-color: #f66;' %}
-{% endif %}
-<span style="{{ style }}white-space:nowrap; color:#2f2f2f; display:inline-block; min-height:24px; border-right:1px solid #cdcdcd; padding:5px 10px 5px 6px; ">
+<span style="white-space:nowrap; color:#2f2f2f; display:inline-block; min-height:24px; border-right:1px solid #cdcdcd; padding:5px 10px 5px 6px; ">
      {{ icon|default('') }}
      {{ text|default('') }}
 </span>

+ 0 - 10
src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php

@@ -24,16 +24,6 @@ abstract class DataCollector implements DataCollectorInterface, \Serializable
 {
     protected $data;
 
-    /**
-     * Returns the status of the collector.
-     *
-     * @return integer The status of the collector
-     */
-    public function getStatus()
-    {
-        return self::INFO;
-    }
-
     public function serialize()
     {
         return serialize($this->data);

+ 0 - 11
src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php

@@ -22,10 +22,6 @@ use Symfony\Component\HttpFoundation\Response;
  */
 interface DataCollectorInterface
 {
-    const INFO = 'info';
-    const WARNING = 'warning';
-    const ERROR = 'error';
-    
     /**
      * Collects data for the given Request and Response.
      *
@@ -41,11 +37,4 @@ interface DataCollectorInterface
      * @return string The collector name
      */
     function getName();
-
-    /**
-     * Returns the status of the collector.
-     *
-     * @return string The status of the collector
-     */
-    function getStatus();
 }

+ 0 - 8
src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php

@@ -72,12 +72,4 @@ class LoggerDataCollector extends DataCollector
     {
         return 'logger';
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getStatus()
-    {
-        return 0 === $this->countErrors() ? self::INFO : self::ERROR;
-    }
 }