Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d762dd1

Browse filesBrowse files
committed
remove deprecated features
1 parent 592c8fe commit d762dd1
Copy full SHA for d762dd1

File tree

8 files changed

+18
-27
lines changed
Filter options

8 files changed

+18
-27
lines changed

‎src/Symfony/Bridge/Monolog/Logger.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Logger.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function countErrors()
5050
*/
5151
public function clear()
5252
{
53-
if (($logger = $this->getDebugLogger()) && method_exists($logger, 'clear')) {
53+
if ($logger = $this->getDebugLogger()) {
5454
$logger->clear();
5555
}
5656
}

‎src/Symfony/Component/EventDispatcher/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* removed the `ContainerAwareEventDispatcher` class
8+
* added the `reset()` method to the `TraceableEventDispatcherInterface`
89

910
3.4.0
1011
-----

‎src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcherInterface.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
/**
1717
* @author Fabien Potencier <fabien@symfony.com>
18-
*
19-
* @method reset() Resets the trace.
2018
*/
2119
interface TraceableEventDispatcherInterface extends EventDispatcherInterface
2220
{
@@ -33,4 +31,9 @@ public function getCalledListeners();
3331
* @return array An array of not called listeners
3432
*/
3533
public function getNotCalledListeners();
34+
35+
/**
36+
* Resets the trace.
37+
*/
38+
public function reset();
3639
}

‎src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
* DataCollectorInterface.
1919
*
2020
* @author Fabien Potencier <fabien@symfony.com>
21-
*
22-
* @method reset() Resets this data collector to its initial state.
2321
*/
2422
interface DataCollectorInterface
2523
{
@@ -38,4 +36,9 @@ public function collect(Request $request, Response $response, \Exception $except
3836
* @return string The collector name
3937
*/
4038
public function getName();
39+
40+
/**
41+
* Resets this data collector to its initial state.
42+
*/
43+
public function reset();
4144
}

‎src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class EventDataCollector extends DataCollector implements LateDataCollectorInter
2727

2828
public function __construct(EventDispatcherInterface $dispatcher = null)
2929
{
30-
if ($dispatcher instanceof TraceableEventDispatcherInterface && !method_exists($dispatcher, 'reset')) {
31-
@trigger_error(sprintf('Implementing "%s" without the "reset()" method is deprecated since version 3.4 and will be unsupported in 4.0 for class "%s".', TraceableEventDispatcherInterface::class, \get_class($dispatcher)), E_USER_DEPRECATED);
32-
}
3330
$this->dispatcher = $dispatcher;
3431
}
3532

@@ -49,10 +46,6 @@ public function reset()
4946
$this->data = array();
5047

5148
if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
52-
if (!method_exists($this->dispatcher, 'reset')) {
53-
return; // @deprecated
54-
}
55-
5649
$this->dispatcher->reset();
5750
}
5851
}

‎src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
2929
public function __construct($logger = null, $containerPathPrefix = null)
3030
{
3131
if (null !== $logger && $logger instanceof DebugLoggerInterface) {
32-
if (!method_exists($logger, 'clear')) {
33-
@trigger_error(sprintf('Implementing "%s" without the "clear()" method is deprecated since version 3.4 and will be unsupported in 4.0 for class "%s".', DebugLoggerInterface::class, \get_class($logger)), E_USER_DEPRECATED);
34-
}
35-
3632
$this->logger = $logger;
3733
}
3834

@@ -52,7 +48,7 @@ public function collect(Request $request, Response $response, \Exception $except
5248
*/
5349
public function reset()
5450
{
55-
if ($this->logger && method_exists($this->logger, 'clear')) {
51+
if ($this->logger instanceof DebugLoggerInterface) {
5652
$this->logger->clear();
5753
}
5854
$this->data = array();

‎src/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* DebugLoggerInterface.
1616
*
1717
* @author Fabien Potencier <fabien@symfony.com>
18-
*
19-
* @method clear() Removes all log records.
2018
*/
2119
interface DebugLoggerInterface
2220
{
@@ -37,4 +35,9 @@ public function getLogs();
3735
* @return int The number of errors
3836
*/
3937
public function countErrors();
38+
39+
/**
40+
* Removes all log records.
41+
*/
42+
public function clear();
4043
}

‎src/Symfony/Component/HttpKernel/Profiler/Profiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Profiler/Profiler.php
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ public function collect(Request $request, Response $response, \Exception $except
198198
public function reset()
199199
{
200200
foreach ($this->collectors as $collector) {
201-
if (!method_exists($collector, 'reset')) {
202-
continue;
203-
}
204-
205201
$collector->reset();
206202
}
207203
$this->enabled = $this->initiallyEnabled;
@@ -237,10 +233,6 @@ public function set(array $collectors = array())
237233
*/
238234
public function add(DataCollectorInterface $collector)
239235
{
240-
if (!method_exists($collector, 'reset')) {
241-
@trigger_error(sprintf('Implementing "%s" without the "reset()" method is deprecated since version 3.4 and will be unsupported in 4.0 for class "%s".', DataCollectorInterface::class, \get_class($collector)), E_USER_DEPRECATED);
242-
}
243-
244236
$this->collectors[$collector->getName()] = $collector;
245237
}
246238

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.