Skip to content

Commit 5adf78e

Browse files
authored
Revert "fix: add flag to force object (#416)"
This reverts commit e67638d.
1 parent e67638d commit 5adf78e

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/JWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public static function jsonDecode(string $input)
355355
public static function jsonEncode(array $input): string
356356
{
357357
if (PHP_VERSION_ID >= 50400) {
358-
$json = \json_encode($input, \JSON_UNESCAPED_SLASHES|\JSON_FORCE_OBJECT);
358+
$json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
359359
} else {
360360
// PHP 5.3 only
361361
$json = \json_encode($input);

tests/JWTTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,6 @@ public function testRSEncodeDecodeWithPassphrase()
321321
$this->assertEquals($decoded, $expected);
322322
}
323323

324-
public function testDecodesEmptyArrayAsObject()
325-
{
326-
$key = 'yma6Hq4XQegCVND8ef23OYgxSrC3IKqk';
327-
$payload = [];
328-
$jwt = JWT::encode($payload, $key, 'HS256');
329-
$decoded = JWT::decode($jwt, new Key($key, 'HS256'));
330-
$this->assertEquals((object) $payload, $decoded);
331-
}
332-
333324
/**
334325
* @runInSeparateProcess
335326
* @dataProvider provideEncodeDecode

0 commit comments

Comments
 (0)