From bc584af0a3331acb15166f627041f2d5b1a9c6fd Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Mon, 8 Jun 2026 17:04:37 -0600 Subject: [PATCH 1/5] update packages --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 03e9fd4..beb66d1 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ } ], "require": { - "php": "^7.3|^8.0", - "webmozart/assert": "^1.2", - "guzzlehttp/guzzle": "^6.3|^7.0.1", - "rize/uri-template": "^0.3.5|^0.4.0" + "php": "^8.2", + "webmozart/assert": "^2.0", + "guzzlehttp/guzzle": "^7.0", + "rize/uri-template": "^0.4.0" }, "require-dev": { - "phpunit/phpunit": "^8.4", + "phpunit/phpunit": "^10.0", "phpstan/phpstan": "^1.10", "friendsofphp/php-cs-fixer": "^3.4", "mockery/mockery": "^1.1", From bf77270791cc3a5be9328d10165bda9846bc6e4d Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Mon, 8 Jun 2026 17:04:58 -0600 Subject: [PATCH 2/5] update method signature to match parent --- src/Assert/Assert.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Assert/Assert.php b/src/Assert/Assert.php index 00b0901..7c40d3b 100644 --- a/src/Assert/Assert.php +++ b/src/Assert/Assert.php @@ -12,9 +12,9 @@ class Assert extends BaseAssert /** * {@inheritdoc} * - * @return InvalidArgumentException + * @throws InvalidArgumentException */ - protected static function reportInvalidArgument($message) + protected static function reportInvalidArgument(string $message): never { throw new InvalidArgumentException($message); } From 3681bb8d045c8a0f7729169a3243c44f0a37aa95 Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Mon, 8 Jun 2026 17:05:32 -0600 Subject: [PATCH 3/5] update phpunit configuration for new version --- phpunit.xml.dist | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 38ed5ef..7e27d2b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,24 @@ - - - - - ./tests - - - - - - ./src - - - - - - - - - - - - + + + + + + + + + + ./tests + + + + + + + + + + ./src + + From ef503cfe25ce1ea6961fdb9e99416f043b55468a Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Mon, 8 Jun 2026 17:06:14 -0600 Subject: [PATCH 4/5] make providers static, remove deprecated ReflectionClass::setAccessible() --- tests/Conversations/ConversationFiltersTest.php | 4 ++-- tests/Conversations/ConversationRequestTest.php | 2 +- tests/Customers/CustomerFiltersTest.php | 4 ++-- tests/Customers/CustomerRequestTest.php | 2 +- tests/Http/AuthenticatorTest.php | 2 +- tests/Http/RestClientTest.php | 4 ++-- tests/Mailboxes/MailboxRequestTest.php | 2 +- tests/ReflectionTestTrait.php | 3 --- tests/Reports/ReportTest.php | 2 +- 9 files changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/Conversations/ConversationFiltersTest.php b/tests/Conversations/ConversationFiltersTest.php index e76739b..64e714f 100644 --- a/tests/Conversations/ConversationFiltersTest.php +++ b/tests/Conversations/ConversationFiltersTest.php @@ -99,7 +99,7 @@ public function testWithValidSortField($sortField) ], $filters->getParams()); } - public function sortFieldProvider(): array + public static function sortFieldProvider(): array { return [ ['createdAt'], @@ -133,7 +133,7 @@ public function testWithValidSortOrder($sortOrder, $sortOrderParam) ], $filters->getParams()); } - public function sortOrderProvider(): array + public static function sortOrderProvider(): array { return [ ['asc', 'asc'], diff --git a/tests/Conversations/ConversationRequestTest.php b/tests/Conversations/ConversationRequestTest.php index 4acdac5..a3a9981 100644 --- a/tests/Conversations/ConversationRequestTest.php +++ b/tests/Conversations/ConversationRequestTest.php @@ -23,7 +23,7 @@ public function testAddsLinks($rel) $this->assertTrue($request->hasLink($rel)); } - public function linkProvider() + public static function linkProvider() { return [ [ConversationLinks::MAILBOX], diff --git a/tests/Customers/CustomerFiltersTest.php b/tests/Customers/CustomerFiltersTest.php index 25c49d2..47ea6a8 100644 --- a/tests/Customers/CustomerFiltersTest.php +++ b/tests/Customers/CustomerFiltersTest.php @@ -60,7 +60,7 @@ public function testWithValidSortField($sortField) ], $filters->getParams()); } - public function sortFieldProvider(): array + public static function sortFieldProvider(): array { return [ ['score'], @@ -90,7 +90,7 @@ public function testWithValidSortOrder($sortOrder, $sortOrderParam) ], $filters->getParams()); } - public function sortOrderProvider(): array + public static function sortOrderProvider(): array { return [ ['asc', 'asc'], diff --git a/tests/Customers/CustomerRequestTest.php b/tests/Customers/CustomerRequestTest.php index 7e742cf..adaa104 100644 --- a/tests/Customers/CustomerRequestTest.php +++ b/tests/Customers/CustomerRequestTest.php @@ -23,7 +23,7 @@ public function testAddsLinks($rel) $this->assertTrue($request->hasLink($rel)); } - public function linkProvider() + public static function linkProvider() { return [ [CustomerLinks::ADDRESS], diff --git a/tests/Http/AuthenticatorTest.php b/tests/Http/AuthenticatorTest.php index e66badb..a5a9a21 100644 --- a/tests/Http/AuthenticatorTest.php +++ b/tests/Http/AuthenticatorTest.php @@ -188,7 +188,7 @@ public function testIdentifiesWhenToAutoRefreshToken(array $args) ); } - public function autoRefreshAccessTokenProvider(): \Generator + public static function autoRefreshAccessTokenProvider(): \Generator { $typesThatCanRefreshTokens = [ ClientCredentials::TYPE, diff --git a/tests/Http/RestClientTest.php b/tests/Http/RestClientTest.php index 50db219..bafb8af 100644 --- a/tests/Http/RestClientTest.php +++ b/tests/Http/RestClientTest.php @@ -193,7 +193,7 @@ public function testDeciderDoesNotRetry(...$params) $this->assertFalse($shouldRetry); } - public function noRetryParamProvider(): \Generator + public static function noRetryParamProvider(): \Generator { $request = new Request( 'POST', @@ -272,7 +272,7 @@ public function testDeciderDoesRetry(...$params) $this->assertTrue($shouldRetry); } - public function retryParamProvider(): \Generator + public static function retryParamProvider(): \Generator { $request = new Request( 'POST', diff --git a/tests/Mailboxes/MailboxRequestTest.php b/tests/Mailboxes/MailboxRequestTest.php index 1d52f87..745f7f8 100644 --- a/tests/Mailboxes/MailboxRequestTest.php +++ b/tests/Mailboxes/MailboxRequestTest.php @@ -23,7 +23,7 @@ public function testAddsLinks($rel) $this->assertTrue($request->hasLink($rel)); } - public function linkProvider() + public static function linkProvider() { return [ [MailboxLinks::FIELDS], diff --git a/tests/ReflectionTestTrait.php b/tests/ReflectionTestTrait.php index f1ccdd1..77444f6 100644 --- a/tests/ReflectionTestTrait.php +++ b/tests/ReflectionTestTrait.php @@ -19,7 +19,6 @@ public function invokeMethod($object, string $method, array $parameters = []) $reflection = new \ReflectionClass($class); $reflectedMethod = $reflection->getMethod($method); - $reflectedMethod->setAccessible(true); return $reflectedMethod->invokeArgs($object, $parameters); } @@ -35,7 +34,6 @@ public function getAttribute($object, string $attributeName) { $reflection = new \ReflectionClass($object); $property = $reflection->getProperty($attributeName); - $property->setAccessible(true); return $property->getValue($object); } @@ -51,7 +49,6 @@ public function setAttribute($object, string $attributeName, $value): void $class = $this->getClassName($object); $reflection = new \ReflectionProperty($class, $attributeName); - $reflection->setAccessible(true); $reflection->setValue($object, $value); } diff --git a/tests/Reports/ReportTest.php b/tests/Reports/ReportTest.php index 7e9c67e..20e7d7a 100644 --- a/tests/Reports/ReportTest.php +++ b/tests/Reports/ReportTest.php @@ -9,7 +9,7 @@ class ReportTest extends TestCase { - public function reportTypeProvider(): array + public static function reportTypeProvider(): array { return [ [Reports\Company\Overall::class], From f8f24a70aa3a50bd55d347cb1b59e91d9b0519de Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Tue, 9 Jun 2026 10:51:55 -0600 Subject: [PATCH 5/5] no need for polyfills on lower versions --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index beb66d1..1820989 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,12 @@ "mockery/mockery": "^1.1", "ramsey/uuid": "^4.1" }, + "replace": { + "symfony/polyfill-php74": "*", + "symfony/polyfill-php80": "*", + "symfony/polyfill-php81": "*", + "symfony/polyfill-php82": "*" + }, "autoload": { "psr-4": { "HelpScout\\Api\\": "src/" } },