Code Duplication    Length = 11-12 lines in 2 locations

main/inc/lib/TicketManager.php 1 location

@@ 496-506 (lines=11) @@
493
                }
494
495
                // Send notification to all users
496
                if (!empty($usersInCategory)) {
497
                    foreach ($usersInCategory as $data) {
498
                        if ($data['user_id']) {
499
                            MessageManager::send_message_simple(
500
                                $data['user_id'],
501
                                $subject,
502
                                $message
503
                            );
504
                        }
505
                    }
506
                }
507
            }
508
509
            global $data_files;

main/inc/lib/AnnouncementEmail.php 1 location

@@ 347-358 (lines=12) @@
344
                        $this->course['code'],
345
                        $sessionId
346
                    );
347
                    if (!empty($userList)) {
348
                        foreach ($userList as $user) {
349
                            MessageManager::send_message_simple(
350
                                $user['user_id'],
351
                                $subject,
352
                                $message,
353
                                $sender['user_id'],
354
                                false,
355
                                true
356
                            );
357
                        }
358
                    }
359
                }
360
            }
361
        }