@@ 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. |
@@ 781-792 (lines=12) @@ | ||
778 | * |
|
779 | * @return self |
|
780 | */ |
|
781 | public function addData($key, $value) |
|
782 | { |
|
783 | if (!is_string($key)) { |
|
784 | throw new \InvalidArgumentException('Data keys must be of type string in order to convert data in a valid JSON Object.'); |
|
785 | } |
|
786 | ||
787 | $data = $this->getData(); |
|
788 | ||
789 | $data[$key] = $value; |
|
790 | ||
791 | return $this->setData($data); |
|
792 | } |
|
793 | } |
|
794 |