Skip to content

Commit

Permalink
Replaced toString with jsonSerialize() on RegistrationRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Samyoul committed Dec 13, 2016
1 parent 2afb7b8 commit 71ebc19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/RegistrationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Samyoul\U2F\U2FServer;


class RegistrationRequest
class RegistrationRequest implements \JsonSerializable
{
/** Protocol version */
protected $version = U2FServer::VERSION;
Expand Down Expand Up @@ -44,9 +44,13 @@ public function appId()
return $this->appId;
}

public function __toString()
public function jsonSerialize()
{
return json_encode($this);
return [
'version' => $this->version,
'challenge' => $this->challenge,
'appId' => $this->appId,
];
}

}

0 comments on commit 71ebc19

Please sign in to comment.