src/Jobs/RecurringJob.php
public function setData($data): void
    {
        if (is_array($data) || $data instanceof JobData) {
            $update = json_encode($data, JSON_UNESCAPED_SLASHES);
        } elseif (is_string($data)) {
            // Assume this is JSON
            $update = $data;
        } else {
            throw new InvalidArgumentException(
                sprintf(
                    "Job's data must be either an array, or a JobData instance, or a JSON string, %s given.",
                    gettype($data)
                )
            );
        }

        if ($this->client->call('recur.update', $this->jid, 'data', $update)) {
            if ($data instanceof JobData) {
                parent::setData($data);
            } elseif (is_array($data)) {
                parent::setData(new JobData($data));
            } else {
                parent::setData(new JobData(json_decode($data, true) ?: []));
            }
        }
    }
public function setData($data): void
    {
        if (is_array($data) || $data instanceof JobData) {
            $update = json_encode($data, JSON_UNESCAPED_SLASHES);
        } elseif (is_string($data)) {
            // Assume this is JSON
            $update = $data;
        } else {
            throw new InvalidArgumentException(
                sprintf(
                    "Job's data must be either an array, or a JobData instance, or a JSON string, %s given.",
                    gettype($data)
                )
            );
        }

        if ($this->client->call('recur.update', $this->jid, 'data', $update)) {
            if ($data instanceof JobData) {
                parent::setData($data);
            } elseif (is_array($data)) {
                parent::setData(new JobData($data));
            } else {
                parent::setData(new JobData(json_decode($data, true) ?: []));
            }
        }
    }
{@inheritdoc}

@param  JobData|array|string $data
@return void

@throws InvalidArgumentException
@throws QlessException
@throws RuntimeException