PHP Interface Tebru\Retrofit\Adapter\DeserializerAdapter

Author: Nate Brunette ([email protected])
Mostra file Open project: tebru/retrofit-php Interface Usage Examples

Public Methods

Method Description
deserialize ( string $data, string $deserializeTo, array $context = [] ) : mixed Deserialize a formatted string to a specific type
fromArray ( array $data, string $deserializeTo, array $context = [] ) : mixed Deserialize an array to a specific type
setDefaultDeserializationContext ( array $context ) Set the default deserialization context
setDeserializeFrom ( string $deserializeFrom ) The current format data is serialized as

Method Details

deserialize() public method

Deserialize a formatted string to a specific type
public deserialize ( string $data, string $deserializeTo, array $context = [] ) : mixed
$data string Data represented as a string
$deserializeTo string What data should be deserialized to
$context array Deserializer specific context
return mixed

fromArray() public method

Deserialize an array to a specific type
public fromArray ( array $data, string $deserializeTo, array $context = [] ) : mixed
$data array Data represented as an array
$deserializeTo string What data should be deserialized to
$context array Deserializer specific context
return mixed

setDefaultDeserializationContext() public method

Set the default deserialization context
public setDefaultDeserializationContext ( array $context )
$context array

setDeserializeFrom() public method

The current format data is serialized as
public setDeserializeFrom ( string $deserializeFrom )
$deserializeFrom string