Code Duplication    Length = 9-9 lines in 2 locations

src/Entities/Message.php 2 locations

@@ 271-279 (lines=9) @@
268
        }
269
270
        $this->photo = isset($data['photo']) ? $data['photo'] : null; //array of photosize
271
        if (!empty($this->photo)) {
272
            foreach ($this->photo as $photo) {
273
                if (!empty($photo)) {
274
                    $photos[] = new PhotoSize($photo);
275
                }
276
            }
277
            $this->photo = $photos;
278
            $this->type  = 'Photo';
279
        }
280
281
        $this->sticker = isset($data['sticker']) ? $data['sticker'] : null;
282
        if (!empty($this->sticker)) {
@@ 345-353 (lines=9) @@
342
        }
343
344
        $this->new_chat_photo = isset($data['new_chat_photo']) ? $data['new_chat_photo'] : null; //array of photosize
345
        if (!empty($this->new_chat_photo)) {
346
            foreach ($this->new_chat_photo as $photo) {
347
                if (!empty($photo)) {
348
                    $photos[] = new PhotoSize($photo);
349
                }
350
            }
351
            $this->new_chat_photo = $photos;
352
            $this->type           = 'new_chat_photo';
353
        }
354
355
        $this->delete_chat_photo = isset($data['delete_chat_photo']) ? $data['delete_chat_photo'] : null;
356
        if ($this->delete_chat_photo) {