Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
46 | public function format( DataValue $value, $dataTypeId, GenericOptions $options = null ) { |
||
47 | if ( $options === null ) { |
||
48 | $options = new GenericOptions(); |
||
49 | } |
||
50 | |||
51 | $params = [ |
||
52 | 'datavalue' => json_encode( $this->dataValueSerializer->serialize( $value ) ), |
||
53 | 'datatype' => $dataTypeId, |
||
54 | 'options' => json_encode( $options->getOptions() ), |
||
55 | ]; |
||
56 | |||
57 | $result = $this->api->getRequest( new SimpleRequest( 'wbformatvalue', $params ) ); |
||
58 | return $result['result']; |
||
59 | } |
||
60 | |||
62 |