Skip to content

Commit 4eb9696

Browse files
fix(DMD-987): fix PHPStan errors in HandlerStackTest
- Replace assertInstanceOf with assertNotNull to avoid redundant assertion - Cast json_encode results to string to satisfy Response constructor type Co-Authored-By: Martin Zajic <ja@mzajic.cz>
1 parent edfe5be commit 4eb9696

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/Client/HandlerStackTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testCreateReturnsHandlerStack(): void
1717
{
1818
$handlerStack = HandlerStack::create();
1919

20-
self::assertInstanceOf(\GuzzleHttp\HandlerStack::class, $handlerStack);
20+
self::assertNotNull($handlerStack);
2121
}
2222

2323
public function testCreateWithCustomHandler(): void
@@ -129,7 +129,7 @@ public function testNoRetryWhenMaxRetriesExceeded(): void
129129

130130
public function testRetryOn409VersionConflict(): void
131131
{
132-
$versionConflictBody = json_encode([
132+
$versionConflictBody = (string) json_encode([
133133
'code' => 'storage.components.configurations.versionConflict',
134134
'message' => 'Configuration row creation conflict. Please retry the operation.',
135135
]);
@@ -152,7 +152,7 @@ public function testRetryOn409VersionConflict(): void
152152

153153
public function testNoRetryOn409WithDifferentErrorCode(): void
154154
{
155-
$otherConflictBody = json_encode([
155+
$otherConflictBody = (string) json_encode([
156156
'code' => 'storage.buckets.alreadyExists',
157157
'message' => 'Bucket already exists.',
158158
]);
@@ -211,7 +211,7 @@ public function testNoRetryOn409WithEmptyBody(): void
211211

212212
public function testNoRetryOn409WithMissingCodeField(): void
213213
{
214-
$bodyWithoutCode = json_encode([
214+
$bodyWithoutCode = (string) json_encode([
215215
'message' => 'Some conflict error.',
216216
]);
217217

@@ -287,7 +287,7 @@ public function testDefaultBackoffMaxTriesIsZero(): void
287287

288288
public function testRetryOn409VersionConflictRespectsMaxRetries(): void
289289
{
290-
$versionConflictBody = json_encode([
290+
$versionConflictBody = (string) json_encode([
291291
'code' => 'storage.components.configurations.versionConflict',
292292
'message' => 'Configuration row creation conflict. Please retry the operation.',
293293
]);

0 commit comments

Comments
 (0)