JsonMapper
A class that converts JSON data to equivalent Hack collections.
Instance Methods
| Returns | Signature and Description |
|---|---|
Map<string,mixed> | toMap()Converts a JSON string to a Map. |
Vector<mixed> | toVector()Converts a JSON string to a Vector. |
Method Details
toMap
public function
toMap(?string $json)Converts a JSON string to a Map.
| Name | Type | Description |
|---|---|---|
$json | ?string | The JSON to convert |
| Type | Description |
|---|---|
Map<string,mixed> | The |
| Type | Conditions |
|---|---|
Illegible | if the JSON is invalid |
toVector
public function
toVector(?string $json)Converts a JSON string to a Vector.
| Name | Type | Description |
|---|---|---|
$json | ?string | The JSON to convert |
| Type | Description |
|---|---|
Vector<mixed> | The |
| Type | Conditions |
|---|---|
Illegible | if the JSON is invalid |