Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | 3 | public static function from_json( $object ) { |
|
46 | 3 | $validator = new \JsonSchema\Validator(); |
|
47 | |||
48 | 3 | $validator->validate( |
|
49 | 3 | $object, |
|
50 | (object) array( |
||
51 | 3 | '$ref' => 'file://' . \realpath( __DIR__ . '/../json-schemas/response-header.json' ), |
|
52 | ), |
||
53 | 3 | \JsonSchema\Constraints\Constraint::CHECK_MODE_EXCEPTIONS |
|
54 | ); |
||
55 | |||
56 | /* phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase */ |
||
57 | 3 | return new self( $object->requestTimestamp ); |
|
58 | } |
||
69 |