src/FCMMessageTopic.php
public function to($recipient)
    {
        if (! ($recipient instanceof Topics)) {
            $type = gettype($recipient);
            if (is_object($recipient)) {
                $type = get_class($recipient);
            }

            return new InvalidArgumentException(
               'The argument for %s::%s must be instanceof %s, null or array. %s given.',
                [
                    self::class, 'to', Topics::class, $type,
                ]
            );
        }

        return parent::to($recipient);
    }
public function to($recipient)
    {
        if (! ($recipient instanceof Topics)) {
            $type = gettype($recipient);
            if (is_object($recipient)) {
                $type = get_class($recipient);
            }

            return new InvalidArgumentException(
               'The argument for %s::%s must be instanceof %s, null or array. %s given.',
                [
                    self::class, 'to', Topics::class, $type,
                ]
            );
        }

        return parent::to($recipient);
    }
{@inheritdoc}