8000 Add return types to JsonSerializable implementations · symfony/http-foundation@89c7cca · GitHub
[go: up one dir, main page]

Skip to content

Commit 89c7cca

Browse files
committed
Add return types to JsonSerializable implementations
1 parent 7239a29 commit 89c7cca

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Tests/JsonResponseTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ public function testSetContentJsonSerializeError()
224224
{
225225
$this->expectException(\Exception::class);
226226
$this->expectExceptionMessage('This error is expected');
227-
if (!interface_exists(\JsonSerializable::class, false)) {
228-
$this->markTestSkipped('JsonSerializable is required.');
229-
}
230227

231228
$serializable = new JsonSerializableObject();
232229

@@ -280,12 +277,10 @@ public function testConstructorWithObjectWithoutToStringMethodThrowsAnException(
280277
}
281278
}
282279

283-
if (interface_exists(\JsonSerializable::class, false)) {
284-
class JsonSerializableObject implements \JsonSerializable
280+
class JsonSerializableObject implements \JsonSerializable
281+
{
282+
public function jsonSerialize(): array
285283
{
286-
public function jsonSerialize()
287-
{
288-
throw new \Exception('This error is expected');
289-
}
284+
throw new \Exception('This error is expected');
290285
}
291286
}

0 commit comments

Comments
 (0)
0