public function setCallback(string $callback = null): JsonResponse
    {
        if (null !== $callback) {
            // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
            $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
            $parts   = explode('.', $callback);

            foreach ($parts as $part) {
                if (! preg_match($pattern, $part)) {
                    throw new \InvalidArgumentException(
                        'The callback name is not valid.'
                    );
                }
            }
        }

        $this->callback = $callback;

        return $this->update();
    }