diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f86a57..c17e418 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: [ '8.2', '8.3', '8.4', '8.5' ] dependencies: ['highest'] include: - - php-version: '8.1' + - php-version: '8.2' dependencies: 'lowest' steps: @@ -51,7 +51,7 @@ jobs: fi - name: Code Coverage Report - if: success() && matrix.php-version == '8.1' + if: success() && matrix.php-version == '8.2' uses: codecov/codecov-action@v5 cs-stan: diff --git a/src/Log/Engines/SentryLog.php b/src/Log/Engines/SentryLog.php index 27618a1..6d1ee34 100644 --- a/src/Log/Engines/SentryLog.php +++ b/src/Log/Engines/SentryLog.php @@ -4,7 +4,6 @@ namespace CakeSentry\Log\Engines; use Cake\Event\EventManager; -use Cake\Http\Server; use Cake\Log\Engine\BaseLog; use Psr\Log\LogLevel; use Sentry\Logs\Logs; @@ -22,11 +21,7 @@ public function __construct(array $config = []) parent::__construct($config); // Send the logs to sentry after the client has received the response - if ( - PHP_SAPI !== 'cli' && - function_exists('fastcgi_finish_request') && - method_exists(Server::class, 'terminate') - ) { + if (PHP_SAPI !== 'cli' && function_exists('fastcgi_finish_request')) { $this->logsWillBeFlushed = true; EventManager::instance()->on('Server.terminate', function (): void { Logs::getInstance()->flush(); diff --git a/src/Middleware/CakeSentryPerformanceMiddleware.php b/src/Middleware/CakeSentryPerformanceMiddleware.php index b2eb6ce..cce0493 100644 --- a/src/Middleware/CakeSentryPerformanceMiddleware.php +++ b/src/Middleware/CakeSentryPerformanceMiddleware.php @@ -16,7 +16,6 @@ use Cake\Database\Driver; use Cake\Datasource\ConnectionManager; use Cake\Event\EventManager; -use Cake\Http\Server; use CakeSentry\Database\Log\CakeSentryLog; use CakeSentry\Event\CacheEventListener; use CakeSentry\Event\HttpEventListener; @@ -101,7 +100,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $transaction->setHttpStatus($response->getStatusCode()); - if (function_exists('fastcgi_finish_request') && method_exists(Server::class, 'terminate')) { + if (function_exists('fastcgi_finish_request')) { // Send the transaction to sentry after the client has received the response EventManager::instance()->on('Server.terminate', function () use ($transaction): void { $transaction->finish();