From 04ba5c953b3d182dfee75a535e7c55bccd58282c Mon Sep 17 00:00:00 2001 From: Timo Michna Date: Fri, 17 Dec 2021 00:10:10 +0100 Subject: [PATCH] PHP 8.1 compatibility (#489) * Add PHP 8.1 to test matrix * Fix composer package versions * Set the php-cs-fixer version to 'dev-master' * Reset the php-cs-fixer version to stable one * Set friendsofphp/php-cs-fixer version to 3.4 * Fix PHPStan covariant error in PHP8.1 * Fix optional parameter declared before required parameter error * fix the matrix * more matrix fixing --- composer.json | 2 +- .../Context/Unit/Propagation/ArrayAccessGetterSetterTest.php | 4 ++-- tests/SDK/Integration/ParentBasedTest.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index e2763b156..a2cbef0e8 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "assertwell/phpunit-global-state": "^0.2", "composer/xdebug-handler": "^2.0", "dg/bypass-finals": "^1.3", - "friendsofphp/php-cs-fixer": "^3.0", + "friendsofphp/php-cs-fixer": "^3.4", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.1", "mikey179/vfsstream": "^1.6", diff --git a/tests/Context/Unit/Propagation/ArrayAccessGetterSetterTest.php b/tests/Context/Unit/Propagation/ArrayAccessGetterSetterTest.php index 495f7a9ef..a20806647 100644 --- a/tests/Context/Unit/Propagation/ArrayAccessGetterSetterTest.php +++ b/tests/Context/Unit/Propagation/ArrayAccessGetterSetterTest.php @@ -84,11 +84,11 @@ public function offsetGet($offset) { } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { } - public function offsetUnset($offset) + public function offsetUnset($offset): void { } diff --git a/tests/SDK/Integration/ParentBasedTest.php b/tests/SDK/Integration/ParentBasedTest.php index 164b56e47..a83e770ee 100644 --- a/tests/SDK/Integration/ParentBasedTest.php +++ b/tests/SDK/Integration/ParentBasedTest.php @@ -37,7 +37,7 @@ public function testParentBased( ?SamplerInterface $remoteParentNotSampled = null, ?SamplerInterface $localParentSampled = null, ?SamplerInterface $localParentNotSampled = null, - $expectedDdecision + ?int $expectedDecision = null ): void { $rootSampler = $this->createMockSamplerNeverInvoked(); @@ -48,7 +48,7 @@ public function testParentBased( 'test.opentelemetry.io', API\SpanKind::KIND_INTERNAL ); - $this->assertEquals($expectedDdecision, $decision->getDecision()); + $this->assertEquals($expectedDecision, $decision->getDecision()); } public function parentContextData(): array