Code Duplication    Length = 12-12 lines in 2 locations

src/Model/Message/Attachment/Template/MediaTemplate.php 1 location

@@ 55-66 (lines=12) @@
52
        }
53
    }
54
55
    public function toArray(): array
56
    {
57
        $array = parent::toArray();
58
        $array += [
59
            'payload' => [
60
                'template_type' => Template::TYPE_MEDIA,
61
                'elements' => $this->elements,
62
            ],
63
        ];
64
65
        return $this->arrayFilter($array);
66
    }
67
}
68

src/Model/Message/Attachment/Template/OpenGraphTemplate.php 1 location

@@ 45-56 (lines=12) @@
42
        return new self($elements);
43
    }
44
45
    public function toArray(): array
46
    {
47
        $array = parent::toArray();
48
        $array += [
49
            'payload' => [
50
                'template_type' => Template::TYPE_OPEN_GRAPH,
51
                'elements' => $this->elements,
52
            ],
53
        ];
54
55
        return $this->arrayFilter($array);
56
    }
57
}
58