Skip to content

Commit

Permalink
Merge pull request #5 from ElAberino/main
Browse files Browse the repository at this point in the history
Fix constructor and method calls.
  • Loading branch information
cindreta authored Dec 6, 2022
2 parents 10e5862 + 3e7efde commit d68b1a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
17 changes: 14 additions & 3 deletions src/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,20 @@ public static function getSubscribedEvents(): array

public function onKernelRequest(RequestEvent $event): void
{
if ($event->isMasterRequest()) {
$this->httpRequest = $event->getRequest();
$this->timestampStart = microtime(true);
if (method_exists($event, 'isMainRequest')) { // Symfony >= 5.3
if ($event->isMainRequest()) {
$this->httpRequest = $event->getRequest();
$this->timestampStart = microtime(true);
}

return;
}

if (method_exists($event, 'isMasterRequest')) { // Symfony < 5.3
if ($event->isMasterRequest()) {
$this->httpRequest = $event->getRequest();
$this->timestampStart = microtime(true);
}
}
}

Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/TreblleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public static function createTreblle(
ErrorDataProvider $errorDataProvider
): Treblle {
return new Treblle(
$configuration->getEndpointUrl(),
$configuration->getApiKey(),
$configuration->getProjectId(),
$client,
Expand Down
1 change: 0 additions & 1 deletion tests/TreblleIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ protected function setUp(): void
$this->dataProvider = new DataProvider(new PayloadAnonymizer([]));

$this->treblle = new Treblle(
'http://127.0.0.1',
'my api key',
'my project id',
$client,
Expand Down

0 comments on commit d68b1a2

Please sign in to comment.