refactor: optimize notification and email sending with single loop and improved code structure
- Replace separate sendCloudNotifications() and sendEmails() methods with combined sendNotificationsAndEmails() - Break down large function into smaller, focused methods following Single Responsibility Principle - Add prepareCloudNotification() for notification setup - Add processUsersForNotificationsAndEmails() for main processing loop - Add sendNotificationToUserIfValid() and sendEmailToUserIfValid() for specific logic - Add prepareEmailSubject() and prepareEmailMessage() for email content preparation - Add logNotificationAndEmailSummary() for centralized logging - Improve performance by eliminating duplicate user list iteration - Enhance maintainability and testability with smaller, focused functions - Apply PHP CS Fixer formatting for code standards compliance
Loading
Please register or sign in to comment