| @@ 264-275 (lines=12) @@ | ||
| 261 | * |
|
| 262 | * @throws \InvalidArgumentException If the passed decoding is invalid. |
|
| 263 | */ |
|
| 264 | public function setObjectDecoding($decoding) |
|
| 265 | { |
|
| 266 | if (self::OBJECT !== $decoding && self::ASSOC_ARRAY !== $decoding) { |
|
| 267 | throw new \InvalidArgumentException(sprintf( |
|
| 268 | 'Expected JsonDecoder::JSON_OBJECT or JsonDecoder::ASSOC_ARRAY. '. |
|
| 269 | 'Got: %s', |
|
| 270 | $decoding |
|
| 271 | )); |
|
| 272 | } |
|
| 273 | ||
| 274 | $this->objectDecoding = $decoding; |
|
| 275 | } |
|
| 276 | ||
| 277 | /** |
|
| 278 | * Returns the decoding of big integers. |
|
| @@ 296-307 (lines=12) @@ | ||
| 293 | * |
|
| 294 | * @throws \InvalidArgumentException If the passed decoding is invalid. |
|
| 295 | */ |
|
| 296 | public function setBigIntDecoding($decoding) |
|
| 297 | { |
|
| 298 | if (self::FLOAT !== $decoding && self::STRING !== $decoding) { |
|
| 299 | throw new \InvalidArgumentException(sprintf( |
|
| 300 | 'Expected JsonDecoder::FLOAT or JsonDecoder::JSON_STRING. '. |
|
| 301 | 'Got: %s', |
|
| 302 | $decoding |
|
| 303 | )); |
|
| 304 | } |
|
| 305 | ||
| 306 | $this->bigIntDecoding = $decoding; |
|
| 307 | } |
|
| 308 | ||
| 309 | private function decodeJson($json) |
|
| 310 | { |
|