@@ -126,74 +108,53 @@
{% endblock %}
{% block panel %}
- {% if collector.applicationname %}
- {# this application is not the Symfony framework #}
-
Project Configuration
+
Symfony Configuration
-
-
- {{ collector.applicationname }}
- Application name
-
+
+
+ {{ collector.symfonyversion }}
+ Symfony version
+
+ {% if 'n/a' != collector.env %}
- {{ collector.applicationversion }}
- Application version
+ {{ collector.env }}
+ Environment
-
-
-
- Based on Symfony {{ collector.symfonyversion }}
-
- {% else %}
-
Symfony Configuration
+ {% endif %}
-
+ {% if 'n/a' != collector.debug %}
- {{ collector.symfonyversion }}
- Symfony version
+ {{ collector.debug ? 'enabled' : 'disabled' }}
+ Debug
+ {% endif %}
+
- {% if 'n/a' != collector.env %}
-
- {{ collector.env }}
- Environment
-
- {% endif %}
-
- {% if 'n/a' != collector.debug %}
-
- {{ collector.debug ? 'enabled' : 'disabled' }}
- Debug
-
- {% endif %}
-
-
- {% set symfony_status = { dev: 'Unstable Version', stable: 'Stable Version', eom: 'Maintenance Ended', eol: 'Version Expired' } %}
- {% set symfony_status_class = { dev: 'warning', stable: 'success', eom: 'warning', eol: 'error' } %}
-
-
-
- Symfony Status |
- Bugs {{ collector.symfonystate in ['eom', 'eol'] ? 'were' : 'are' }} fixed until |
- Security issues {{ collector.symfonystate == 'eol' ? 'were' : 'are' }} fixed until |
- |
-
-
-
-
-
- {{ symfony_status[collector.symfonystate]|upper }}
- |
- {{ collector.symfonyeom }} |
- {{ collector.symfonyeol }} |
-
- View roadmap
- |
-
-
-
- {% endif %}
+ {% set symfony_status = { dev: 'Unstable Version', stable: 'Stable Version', eom: 'Maintenance Ended', eol: 'Version Expired' } %}
+ {% set symfony_status_class = { dev: 'warning', stable: 'success', eom: 'warning', eol: 'error' } %}
+
+
+
+ Symfony Status |
+ Bugs {{ collector.symfonystate in ['eom', 'eol'] ? 'were' : 'are' }} fixed until |
+ Security issues {{ collector.symfonystate == 'eol' ? 'were' : 'are' }} fixed until |
+ |
+
+
+
+
+
+ {{ symfony_status[collector.symfonystate]|upper }}
+ |
+ {{ collector.symfonyeom }} |
+ {{ collector.symfonyeol }} |
+
+ View roadmap
+ |
+
+
+
PHP Configuration
diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md
index 476f7843e86f8..8ba132f6c4a4e 100644
--- a/src/Symfony/Component/HttpKernel/CHANGELOG.md
+++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md
@@ -6,6 +6,9 @@ CHANGELOG
* deprecated `KernelInterface::getRootDir()` and the `kernel.root_dir` parameter
* deprecated `KernelInterface::getName()` and the `kernel.name` parameter
+ * deprecated the first and second constructor argument of `ConfigDataCollector`
+ * deprecated `ConfigDataCollector::getApplicationName()`
+ * deprecated `ConfigDataCollector::getApplicationVersion()`
4.1.0
-----
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
index 14b4b480047e3..1d5aad221fe50 100644
--- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
+++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php
@@ -30,12 +30,15 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
private $version;
private $hasVarDumper;
- /**
- * @param string $name The name of the application using the web profiler
- * @param string $version The version of the application using the web profiler
- */
public function __construct(string $name = null, string $version = null)
{
+ if (1 <= \func_num_args()) {
+ @trigger_error(sprintf('The "$name" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+ if (2 <= \func_num_args()) {
+ @trigger_error(sprintf('The "$version" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+
$this->name = $name;
$this->version = $version;
$this->hasVarDumper = class_exists(LinkStub::class);
@@ -105,13 +108,23 @@ public function lateCollect()
$this->data = $this->cloneVar($this->data);
}
+ /**
+ * @deprecated since Symfony 4.2
+ */
public function getApplicationName()
{
+ @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
return $this->data['app_name'];
}
+ /**
+ * @deprecated since Symfony 4.2
+ */
public function getApplicationVersion()
{
+ @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
return $this->data['app_version'];
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
index 4d40560792d0a..800f682663f23 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php
@@ -41,15 +41,26 @@ public function testCollect()
$this->assertSame(\extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache());
$this->assertSame(\extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu());
}
-}
-class KernelForTest extends Kernel
-{
- public function getName()
+ /**
+ * @group legacy
+ * @expectedDeprecation The "$name" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The "$version" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationName()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationVersion()" is deprecated since Symfony 4.2.
+ */
+ public function testLegacy()
{
- return 'testkernel';
+ $c = new ConfigDataCollector('name', null);
+ $c->collect(new Request(), new Response());
+
+ $this->assertSame('name', $c->getApplicationName());
+ $this->assertNull($c->getApplicationVersion());
}
+}
+class KernelForTest extends Kernel
+{
public function registerBundles()
{
}