code: public function appendRow($singleRow = null)
      {
          if (!is_null($singleRow)) {
              if ($singleRow instanceof Row) {
                  $this->collection[] = $singleRow;
                  $singleRow->acceptChanges();
              } elseif (is_array($singleRow)) {
                  $this->collection[] = new Row($singleRow);
              } else {
                  throw new InvalidArgumentException("You must pass an array or a Row object");
              }
          } else {
              $singleRow = new Row();
              $this->collection[] = $singleRow;
              $singleRow->acceptChanges();
          }
          $this->currentRow = count($this->collection) - 1;
      }
docs: Append one row to AnyDataset.
  
  @param Row $singleRow
  @return void
  @throws \ByJG\Serializer\Exception\InvalidArgumentException