How can the EVA (Event-Action) principle be applied to improve PHP code structure?

The EVA (Event-Action) principle can be applied in PHP code structure by separating the event triggers from the actions that should be performed. This helps in making the code more modular, maintainable, and easier to understand.

// Event trigger
function userLoggedInEvent() {
    // Perform actions when user logs in
    logActivity('User logged in');
    sendWelcomeEmail();
}

// Action functions
function logActivity($message) {
    // Log activity to database
}

function sendWelcomeEmail() {
    // Send welcome email to user
}