Skip to content

Commit 0c70e21

Browse files
authored
Merge pull request #378 from gmponos/remove-sf5-hack-collector
Remove the sf5 compatibility patch from the collector by removing the typehint
2 parents 9a739ad + b39d0ee commit 0c70e21

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

src/Collector/Collector.php

Lines changed: 6 additions & 25 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.
@@ -19,8 +17,7 @@
1917
*
2018
* @internal
2119
*/
22-
// Make this class non-abstract and move collect into it when we drop support for Symfony 4.
23-
abstract class BaseCollector extends DataCollector
20+
class Collector extends DataCollector
2421
{
2522
/**
2623
* @var Stack|null
@@ -192,28 +189,12 @@ public function getTotalDuration()
192189
return $carry + $stack->getDuration();
193190
}, 0);
194191
}
195-
}
196192

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
193+
/**
194+
* {@inheritdoc}
195+
*/
196+
public function collect(Request $request, Response $response, $exception = null)
210197
{
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-
}
198+
// We do not need to collect any data from the Symfony Request and Response
218199
}
219200
}

0 commit comments

Comments
 (0)