Code Duplication    Length = 7-10 lines in 2 locations

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

@@ 3172-3178 (lines=7) @@
3169
3170
		// Do what is necessary for each module.
3171
		switch ( $module ) {
3172
			case 'monitor':
3173
				// Load the class to use the method. If class can't be found, do nothing.
3174
				if ( ! class_exists( 'Jetpack_Monitor' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3175
					return false;
3176
				}
3177
				$value = Jetpack_Monitor::user_receives_notifications( false );
3178
				break;
3179
3180
			case 'post-by-email':
3181
				// Load the class to use the method. If class can't be found, do nothing.
@@ 3180-3189 (lines=10) @@
3177
				$value = Jetpack_Monitor::user_receives_notifications( false );
3178
				break;
3179
3180
			case 'post-by-email':
3181
				// Load the class to use the method. If class can't be found, do nothing.
3182
				if ( ! class_exists( 'Jetpack_Post_By_Email' ) && ! include_once( Jetpack::get_module_path( $module ) ) ) {
3183
					return false;
3184
				}
3185
				$value = Jetpack_Post_By_Email::init()->get_post_by_email_address();
3186
				if ( $value === null ) {
3187
					$value = 'NULL'; // sentinel value so it actually gets set
3188
				}
3189
				break;
3190
		}
3191
3192
		// Normalize value to boolean.