Skip to content

Commit

Permalink
Merge pull request #30 from LordSimal/fix-stan
Browse files Browse the repository at this point in the history
fix stan
  • Loading branch information
LordSimal authored Dec 29, 2024
2 parents ecdbd4b + 023c9b8 commit 707eb00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Http/SentryClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function getQueryLoggers(): void
if ($connection->configName() === 'debug_kit') {
continue;
}
/** @var \Cake\Database\Driver $driver */
/** @var \Cake\Database\Driver|object $driver */
$driver = $connection->getDriver();

if ($driver instanceof Driver) {
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/CakeSentryPerformanceMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function addQueryData(): void
continue;
}
$logger = null;
/** @var \Cake\Database\Driver $driver */
/** @var \Cake\Database\Driver|object $driver */
$driver = $connection->getDriver();
if ($driver instanceof Driver) {
$driverConfig = $driver->config();
Expand Down
6 changes: 4 additions & 2 deletions src/Middleware/CakeSentryQueryMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function enableQueryLogging(): void
continue;
}
$logger = null;
/** @var \Cake\Database\Driver $driver */
/** @var \Cake\Database\Driver|object $driver */
$driver = $connection->getDriver();
if ($driver instanceof Driver) {
$driverConfig = $driver->config();
Expand All @@ -68,7 +68,9 @@ protected function enableQueryLogging(): void
}

$logger = new CakeSentryLog($logger, $name, $includeSchemaReflection);
$driver->setLogger($logger);
if (method_exists($driver, 'setLogger')) {
$driver->setLogger($logger);
}
}
}
}

0 comments on commit 707eb00

Please sign in to comment.