Code Duplication    Length = 7-10 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 3112-3118 (lines=7) @@
3109
3110
		// Do what is necessary for each module.
3111
		switch ( $module ) {
3112
			case 'monitor':
3113
				// Load the class to use the method. If class can't be found, do nothing.
3114
				if ( ! class_exists( 'Jetpack_Monitor' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3115
					return false;
3116
				}
3117
				$value = Jetpack_Monitor::user_receives_notifications( false );
3118
				break;
3119
3120
			case 'post-by-email':
3121
				// Load the class to use the method. If class can't be found, do nothing.
@@ 3120-3129 (lines=10) @@
3117
				$value = Jetpack_Monitor::user_receives_notifications( false );
3118
				break;
3119
3120
			case 'post-by-email':
3121
				// Load the class to use the method. If class can't be found, do nothing.
3122
				if ( ! class_exists( 'Jetpack_Post_By_Email' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3123
					return false;
3124
				}
3125
				$value = Jetpack_Post_By_Email::init()->get_post_by_email_address();
3126
				if ( $value === null ) {
3127
					$value = 'NULL'; // sentinel value so it actually gets set
3128
				}
3129
				break;
3130
		}
3131
3132
		// Normalize value to boolean.