Interface Yiisoft\Queue\Message\Serializer\MessageEncoderInterface
| Implemented by | Yiisoft\Queue\Message\Serializer\JsonMessageEncoder |
|---|
Encodes and decodes a data array to and from a string.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| decode() | Decodes a string representation back into a value. | Yiisoft\Queue\Message\Serializer\MessageEncoderInterface |
| encode() | Encodes a data array into a string representation. | Yiisoft\Queue\Message\Serializer\MessageEncoderInterface |
Method Details
Decodes a string representation back into a value.
| public abstract mixed decode ( string $value ) | ||
| $value | string |
Encoded string. |
| return | mixed |
Decoded data. |
|---|---|---|
| throws | Yiisoft\Queue\Message\Serializer\MessageSerializerException |
If decoding fails. |
public function decode(string $value): mixed;
Encodes a data array into a string representation.
| public abstract string encode ( array $data ) | ||
| $data | array |
Data to encode. Contains only scalars, nulls, and arrays — no objects or resources including array contents. |
| throws | Yiisoft\Queue\Message\Serializer\MessageSerializerException |
If encoding fails. |
|---|---|---|
public function encode(array $data): string;
Signup or Login in order to comment.