Code Duplication    Length = 7-10 lines in 2 locations

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

@@ 3223-3229 (lines=7) @@
3220
3221
		// Do what is necessary for each module.
3222
		switch ( $module ) {
3223
			case 'monitor':
3224
				// Load the class to use the method. If class can't be found, do nothing.
3225
				if ( ! class_exists( 'Jetpack_Monitor' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3226
					return false;
3227
				}
3228
				$value = Jetpack_Monitor::user_receives_notifications( false );
3229
				break;
3230
3231
			case 'post-by-email':
3232
				// Load the class to use the method. If class can't be found, do nothing.
@@ 3231-3240 (lines=10) @@
3228
				$value = Jetpack_Monitor::user_receives_notifications( false );
3229
				break;
3230
3231
			case 'post-by-email':
3232
				// Load the class to use the method. If class can't be found, do nothing.
3233
				if ( ! class_exists( 'Jetpack_Post_By_Email' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3234
					return false;
3235
				}
3236
				$value = Jetpack_Post_By_Email::init()->get_post_by_email_address();
3237
				if ( $value === null ) {
3238
					$value = 'NULL'; // sentinel value so it actually gets set
3239
				}
3240
				break;
3241
		}
3242
3243
		// Normalize value to boolean.