Code Duplication    Length = 7-10 lines in 2 locations

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

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