| @@ 783-794 (lines=12) @@ | ||
| 780 | * |
|
| 781 | * @return self |
|
| 782 | */ |
|
| 783 | public function addData($key, $value) |
|
| 784 | { |
|
| 785 | if (!is_string($key)) { |
|
| 786 | throw new \InvalidArgumentException('Data keys must be of type string in order to convert data in a valid JSON Object.'); |
|
| 787 | } |
|
| 788 | ||
| 789 | $data = $this->getData(); |
|
| 790 | ||
| 791 | $data[$key] = $value; |
|
| 792 | ||
| 793 | return $this->setData($data); |
|
| 794 | } |
|
| 795 | } |
|
| 796 | ||
| @@ 501-512 (lines=12) @@ | ||
| 498 | * |
|
| 499 | * @return self |
|
| 500 | */ |
|
| 501 | public function addData($key, $value) |
|
| 502 | { |
|
| 503 | if (!is_string($key) && !is_int($key)) { |
|
| 504 | throw new \InvalidArgumentException('Data keys must be of type "string" or "integer".'); |
|
| 505 | } |
|
| 506 | ||
| 507 | $data = $this->getData(); |
|
| 508 | ||
| 509 | $data[$key] = $value; |
|
| 510 | ||
| 511 | return $this->setData($data); |
|
| 512 | } |
|
| 513 | ||
| 514 | /** |
|
| 515 | * Get the action array. |
|