Code Duplication    Length = 7-10 lines in 2 locations

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

@@ 3152-3158 (lines=7) @@
3149
3150
		// Do what is necessary for each module.
3151
		switch ( $module ) {
3152
			case 'monitor':
3153
				// Load the class to use the method. If class can't be found, do nothing.
3154
				if ( ! class_exists( 'Jetpack_Monitor' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3155
					return false;
3156
				}
3157
				$value = Jetpack_Monitor::user_receives_notifications( false );
3158
				break;
3159
3160
			case 'post-by-email':
3161
				// Load the class to use the method. If class can't be found, do nothing.
@@ 3160-3169 (lines=10) @@
3157
				$value = Jetpack_Monitor::user_receives_notifications( false );
3158
				break;
3159
3160
			case 'post-by-email':
3161
				// Load the class to use the method. If class can't be found, do nothing.
3162
				if ( ! class_exists( 'Jetpack_Post_By_Email' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3163
					return false;
3164
				}
3165
				$value = Jetpack_Post_By_Email::init()->get_post_by_email_address();
3166
				if ( $value === null ) {
3167
					$value = 'NULL'; // sentinel value so it actually gets set
3168
				}
3169
				break;
3170
		}
3171
3172
		// Normalize value to boolean.