Skip to content

Commit c61f954

Browse files
committed
Remove the sf5 compatibility patch from the collector by removing the typehint
1 parent f83ab03 commit c61f954

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

src/Collector/Collector.php

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
namespace Http\HttplugBundle\Collector;
44

5-
use Symfony\Component\HttpKernel\Kernel;
65
use Symfony\Component\HttpFoundation\Request;
76
use Symfony\Component\HttpFoundation\Response;
87
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
9-
use Throwable;
108

119
/**
1210
* The Collector hold profiled Stacks pushed by StackPlugin. It also have a list of configured clients.
@@ -16,11 +14,8 @@
1614
* other request before the current one is sent by the client.
1715
*
1816
* @author Fabien Bourigault <[email protected]>
19-
*
20-
* @internal
2117
*/
22-
// Make this class non-abstract and move collect into it when we drop support for Symfony 4.
23-
abstract class BaseCollector extends DataCollector
18+
class Collector extends DataCollector
2419
{
2520
/**
2621
* @var Stack|null
@@ -192,28 +187,12 @@ public function getTotalDuration()
192187
return $carry + $stack->getDuration();
193188
}, 0);
194189
}
195-
}
196190

197-
if (Kernel::MAJOR_VERSION >= 5) {
198-
class Collector extends BaseCollector
199-
{
200-
/**
201-
* {@inheritdoc}
202-
*/
203-
public function collect(Request $request, Response $response, Throwable $exception = null)
204-
{
205-
// We do not need to collect any data from the Symfony Request and Response
206-
}
207-
}
208-
} else {
209-
class Collector extends BaseCollector
191+
/**
192+
* {@inheritdoc}
193+
*/
194+
public function collect(Request $request, Response $response, $exception = null)
210195
{
211-
/**
212-
* {@inheritdoc}
213-
*/
214-
public function collect(Request $request, Response $response, \Exception $exception = null)
215-
{
216-
// We do not need to collect any data from the Symfony Request and Response
217-
}
196+
// We do not need to collect any data from the Symfony Request and Response
218197
}
219198
}

0 commit comments

Comments
 (0)