Skip to content

Commit 71ebc19

Browse files
committed
Replaced toString with jsonSerialize() on RegistrationRequest
1 parent 2afb7b8 commit 71ebc19

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/RegistrationRequest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Samyoul\U2F\U2FServer;
99

1010

11-
class RegistrationRequest
11+
class RegistrationRequest implements \JsonSerializable
1212
{
1313
/** Protocol version */
1414
protected $version = U2FServer::VERSION;
@@ -44,9 +44,13 @@ public function appId()
4444
return $this->appId;
4545
}
4646

47-
public function __toString()
47+
public function jsonSerialize()
4848
{
49-
return json_encode($this);
49+
return [
50+
'version' => $this->version,
51+
'challenge' => $this->challenge,
52+
'appId' => $this->appId,
53+
];
5054
}
5155

5256
}

0 commit comments

Comments
 (0)