diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 1a1a1e8c..91c0cee4 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -22,7 +22,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' - name: Install dependencies uses: ramsey/composer-install@v3 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 063c70f6..d7c302a8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,11 +1,10 @@ -name: Continuous Integration +name: CI on: - pull_request: null + pull_request: push: branches: - master - - develop - release/** permissions: @@ -28,6 +27,7 @@ jobs: - '8.1' - '8.2' - '8.3' + - '8.4' symfony-version: - 4.4.* - 5.* @@ -52,6 +52,8 @@ jobs: symfony-version: 7.* - php: '8.1' symfony-version: 7.* + - php: '8.4' + symfony-version: 4.4.* include: - php: '7.2' symfony-version: 4.4.* @@ -82,9 +84,9 @@ jobs: - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Update PHPUnit - run: composer require --dev phpunit/phpunit ^9.3.9 --no-update - if: matrix.php == '8.0' && matrix.dependencies == 'lowest' + # These dependencies are not used running the tests but can cause deprecation warnings so we remove them before running the tests + - name: Remove unused dependencies + run: composer remove vimeo/psalm phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update - name: Install dependencies uses: ramsey/composer-install@v3 @@ -118,7 +120,7 @@ jobs: - php: '8.0' dependencies: lowest symfony-version: 4.4.* - - php: '8.3' + - php: '8.4' dependencies: highest steps: diff --git a/composer.json b/composer.json index ea971f23..b591b465 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": "^7.2||^8.0", "guzzlehttp/psr7": "^2.1.1", "jean85/pretty-package-versions": "^1.5||^2.0", - "sentry/sentry": "^4.9.0", + "sentry/sentry": "^4.10.0", "symfony/cache-contracts": "^1.1||^2.4||^3.0", "symfony/config": "^4.4.20||^5.0.11||^6.0||^7.0", "symfony/console": "^4.4.20||^5.0.11||^6.0||^7.0", @@ -36,7 +36,7 @@ "phpstan/phpstan": "1.12.5", "phpstan/phpstan-phpunit": "1.4.0", "phpstan/phpstan-symfony": "1.4.10", - "phpunit/phpunit": "^8.5.14||^9.3.9", + "phpunit/phpunit": "^8.5.40||^9.6.21", "symfony/browser-kit": "^4.4.20||^5.0.11||^6.0||^7.0", "symfony/cache": "^4.4.20||^5.0.11||^6.0||^7.0", "symfony/dom-crawler": "^4.4.20||^5.0.11||^6.0||^7.0", diff --git a/src/Tracing/HttpClient/TraceableResponseForV5.php b/src/Tracing/HttpClient/TraceableResponseForV5.php index 0ca572a2..c079fe4f 100644 --- a/src/Tracing/HttpClient/TraceableResponseForV5.php +++ b/src/Tracing/HttpClient/TraceableResponseForV5.php @@ -16,7 +16,7 @@ final class TraceableResponseForV5 extends AbstractTraceableResponse implements * * @return mixed */ - public function getInfo(string $type = null) + public function getInfo(?string $type = null) { return $this->response->getInfo($type); } diff --git a/tests/DependencyInjection/Fixtures/php/error_types.php b/tests/DependencyInjection/Fixtures/php/error_types.php index 9c8473e5..6d072037 100644 --- a/tests/DependencyInjection/Fixtures/php/error_types.php +++ b/tests/DependencyInjection/Fixtures/php/error_types.php @@ -7,6 +7,7 @@ /** @var ContainerBuilder $container */ $container->loadFromExtension('sentry', [ 'options' => [ - 'error_types' => \E_ALL & ~(\E_NOTICE | \E_STRICT | \E_DEPRECATED), + // 2048 is \E_STRICT which has been deprecated in PHP 8.4 so we should not reference it directly to prevent deprecation notices + 'error_types' => \E_ALL & ~(\E_NOTICE | 2048 | \E_DEPRECATED), ], ]); diff --git a/tests/DependencyInjection/Fixtures/xml/error_types.xml b/tests/DependencyInjection/Fixtures/xml/error_types.xml index c0c46ab9..4be73596 100644 --- a/tests/DependencyInjection/Fixtures/xml/error_types.xml +++ b/tests/DependencyInjection/Fixtures/xml/error_types.xml @@ -7,6 +7,6 @@ https://sentry.io/schema/dic/sentry-symfony https://sentry.io/schema/dic/sentry-symfony/sentry-1.0.xsd"> - + diff --git a/tests/DependencyInjection/Fixtures/yml/error_types.yml b/tests/DependencyInjection/Fixtures/yml/error_types.yml index 95149254..8c976cd2 100644 --- a/tests/DependencyInjection/Fixtures/yml/error_types.yml +++ b/tests/DependencyInjection/Fixtures/yml/error_types.yml @@ -1,3 +1,3 @@ sentry: options: - error_types: E_ALL & ~(E_NOTICE|E_STRICT|E_DEPRECATED) + error_types: E_ALL & ~(E_NOTICE|2048|E_DEPRECATED) diff --git a/tests/DependencyInjection/SentryExtensionTest.php b/tests/DependencyInjection/SentryExtensionTest.php index bf9aeff7..ae8921c8 100644 --- a/tests/DependencyInjection/SentryExtensionTest.php +++ b/tests/DependencyInjection/SentryExtensionTest.php @@ -288,7 +288,8 @@ public function testErrorTypesOptionIsParsedFromStringToIntegerValue(): void $container = $this->createContainerFromFixture('error_types'); $optionsDefinition = $container->getDefinition('sentry.client.options'); - $this->assertSame(\E_ALL & ~(\E_NOTICE | \E_STRICT | \E_DEPRECATED), $optionsDefinition->getArgument(0)['error_types']); + // 2048 is \E_STRICT which has been deprecated in PHP 8.4 so we should not reference it directly to prevent deprecation notices + $this->assertSame(\E_ALL & ~(\E_NOTICE | 2048 | \E_DEPRECATED), $optionsDefinition->getArgument(0)['error_types']); } /** diff --git a/tests/End2End/App/Controller/TracingController.php b/tests/End2End/App/Controller/TracingController.php index 37579ae4..fa86876a 100644 --- a/tests/End2End/App/Controller/TracingController.php +++ b/tests/End2End/App/Controller/TracingController.php @@ -21,7 +21,7 @@ class TracingController */ private $connection; - public function __construct(HubInterface $hub, Connection $connection = null) + public function __construct(HubInterface $hub, ?Connection $connection = null) { $this->hub = $hub; $this->connection = $connection;