Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09ca33c

Browse files
committed
[HttpKernel] Cleanup legacy in ConfigDataCollector
1 parent 9cc2a4e commit 09ca33c

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,10 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
2626
* @var KernelInterface
2727
*/
2828
private $kernel;
29-
private $name;
30-
private $version;
3129
private $hasVarDumper;
3230

33-
public function __construct(string $name = null, string $version = null)
31+
public function __construct()
3432
{
35-
if (1 <= \func_num_args()) {
36-
@trigger_error(sprintf('The "$name" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
37-
}
38-
if (2 <= \func_num_args()) {
39-
@trigger_error(sprintf('The "$version" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
40-
}
41-
42-
$this->name = $name;
43-
$this->version = $version;
4433
$this->hasVarDumper = class_exists(LinkStub::class);
4534
}
4635

@@ -58,8 +47,6 @@ public function setKernel(KernelInterface $kernel = null)
5847
public function collect(Request $request, Response $response, \Exception $exception = null)
5948
{
6049
$this->data = [
61-
'app_name' => $this->name,
62-
'app_version' => $this->version,
6350
'token' => $response->headers->get('X-Debug-Token'),
6451
'symfony_version' => Kernel::VERSION,
6552
'symfony_state' => 'unknown',
@@ -109,26 +96,6 @@ public function lateCollect()
10996
$this->data = $this->cloneVar($this->data);
11097
}
11198

112-
/**
113-
* @deprecated since Symfony 4.2
114-
*/
115-
public function getApplicationName()
116-
{
117-
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
118-
119-
return $this->data['app_name'];
120-
}
121-
122-
/**
123-
* @deprecated since Symfony 4.2
124-
*/
125-
public function getApplicationVersion()
126-
{
127-
@trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
128-
129-
return $this->data['app_version'];
130-
}
131-
13299
/**
133100
* Gets the token.
134101
*

src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,6 @@ public function testCollect()
4242
$this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());
4343
$this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN), $c->hasApcu());
4444
}
45-
46-
/**
47-
* @group legacy
48-
* @expectedDeprecation The "$name" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
49-
* @expectedDeprecation The "$version" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
50-
* @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationName()" is deprecated since Symfony 4.2.
51-
* @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationVersion()" is deprecated since Symfony 4.2.
52-
*/
53-
public function testLegacy()
54-
{
55-
$c = new ConfigDataCollector('name', null);
56-
$c->collect(new Request(), new Response());
57-
58-
$this->assertSame('name', $c->getApplicationName());
59-
$this->assertNull($c->getApplicationVersion());
60-
}
6145
}
6246

6347
class KernelForTest extends Kernel

0 commit comments

Comments
 (0)