|
2 | 2 |
|
3 | 3 | namespace Http\HttplugBundle\Collector;
|
4 | 4 |
|
5 |
| -use Symfony\Component\HttpKernel\Kernel; |
6 | 5 | use Symfony\Component\HttpFoundation\Request;
|
7 | 6 | use Symfony\Component\HttpFoundation\Response;
|
8 | 7 | use Symfony\Component\HttpKernel\DataCollector\DataCollector;
|
9 |
| -use Throwable; |
10 | 8 |
|
11 | 9 | /**
|
12 | 10 | * The Collector hold profiled Stacks pushed by StackPlugin. It also have a list of configured clients.
|
|
16 | 14 | * other request before the current one is sent by the client.
|
17 | 15 | *
|
18 | 16 | * @author Fabien Bourigault <[email protected]>
|
19 |
| - * |
20 |
| - * @internal |
21 | 17 | */
|
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 |
24 | 19 | {
|
25 | 20 | /**
|
26 | 21 | * @var Stack|null
|
@@ -192,28 +187,12 @@ public function getTotalDuration()
|
192 | 187 | return $carry + $stack->getDuration();
|
193 | 188 | }, 0);
|
194 | 189 | }
|
195 |
| -} |
196 | 190 |
|
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) |
210 | 195 | {
|
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 |
218 | 197 | }
|
219 | 198 | }
|
0 commit comments