getTopic example

if ($message->getOptions() && !$message->getOptions() instanceof NtfyOptions) {
            throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, NtfyOptions::class));
        }

        if (!($opts = $message->getOptions()) && $notification = $message->getNotification()) {
            $opts = NtfyOptions::fromNotification($notification);
        }

        $options = $opts ? $opts->toArray() : [];

        $options['topic'] = $this->getTopic();

        if (!isset($options['title'])) {
            $options['title'] = $message->getSubject();
        }
        if (!isset($options['message'])) {
            $options['message'] = $message->getContent();
        }

        $headers = [];

        if (null !== $this->user && null !== $this->password) {
            
/** * @return array */
    public static function castTopicPartition(TopicPartition $c, array $a)
    {
        $prefix = Caster::PREFIX_VIRTUAL;

        $a += [
            $prefix.'offset' => $c->getOffset(),
            $prefix.'partition' => $c->getPartition(),
            $prefix.'topic' => $c->getTopic(),
        ];

        return $a;
    }

    /** * @return array */
    public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;

        
/** * @return array */
    public static function castTopicPartition(TopicPartition $c, array $a)
    {
        $prefix = Caster::PREFIX_VIRTUAL;

        $a += [
            $prefix.'offset' => $c->getOffset(),
            $prefix.'partition' => $c->getPartition(),
            $prefix.'topic' => $c->getTopic(),
        ];

        return $a;
    }

    /** * @return array */
    public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested)
    {
        $prefix = Caster::PREFIX_VIRTUAL;

        
Home | Imprint | This part of the site doesn't use cookies.