// Gateway Interface interface UserGateway { public function getUserData($userId); } // Gateway Class for External System 1 class ExternalSystem1Gateway implements UserGateway { public function getUserData($userId) { // Code to fetch user data from External System 1 // For simplicity, we return a hardcoded response return [ 'id' => $userId, 'name' => 'John Doe', 'email' => 'john@example.com' ]; } } // Gateway Class for External System 2 class ExternalSystem2Gateway implements UserGateway { public function getUserData($userId) { // Code to fetch user data from External System 2 // For simplicity, we return a hardcoded response return [ 'userId' => $userId, 'userName' => 'Jane Doe', 'userEmail' => 'jane@example.com' ]; } }