for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace BitWasp\Trezor\Bridge\Schema;
class ValidatorFactory
{
const VERSION_RESPONSE_VALIDATOR = <<<EOJSON
"title": "VersionResponse",
"type": "object",
"properties": {
"version": {
"type": "string"
}
},
"required": ["version"]
EOJSON;
const LIST_DEVICES_RESPONSE_VALIDATOR = <<<EOJSON
"title": "ListDevicesResponse",
"type": "array",
"items": {
"path": {
"vendor": {
"type": "number"
"product": {
"session": {
"type": ["string", "null"]
"required": [
"path", "session"
]
const ACQUIRE_RESPONSE_VALIDATOR = <<<EOJSON
"title": "AcquireResponse",
"session"
const RELEASE_RESPONSE_VALIDATOR = <<<EOJSON
"title": "ReleaseResponse",
"properties": {},
"required": []
public function versionResponse(): \stdClass
return json_decode(self::VERSION_RESPONSE_VALIDATOR);
public function listDevicesResponse(): \stdClass
return json_decode(self::LIST_DEVICES_RESPONSE_VALIDATOR);
public function acquireResponse(): \stdClass
return json_decode(self::ACQUIRE_RESPONSE_VALIDATOR);
public function releaseResponse(): \stdClass
return json_decode(self::RELEASE_RESPONSE_VALIDATOR);