Code Duplication    Length = 3-7 lines in 3 locations

json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php 1 location

@@ 18-20 (lines=3) @@
15
16
		// convert list of modules in comma-delimited format into an array
17
		// of "$modulename => true"
18
		if ( isset( $args['modules'] ) && ! empty( $args['modules'] ) ) {
19
			$modules = array_map( '__return_true', array_flip( array_map( 'trim', explode( ',', $args['modules'] ) ) ) );
20
		}
21
22
		foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) {
23
			if ( 'users' === $module_name && isset( $args[ $module_name ] ) && 'initial' === $args[ $module_name ] ) {

modules/contact-form/grunion-contact-form.php 1 location

@@ 2410-2412 (lines=3) @@
2407
		if ( ! empty( $attributes['options'] ) && is_string( $attributes['options'] ) ) {
2408
			$attributes['options'] = array_map( 'trim', explode( ',', $attributes['options'] ) );
2409
2410
			if ( ! empty( $attributes['values'] ) && is_string( $attributes['values'] ) ) {
2411
				$attributes['values'] = array_map( 'trim', explode( ',', $attributes['values'] ) );
2412
			}
2413
		}
2414
2415
		if ( $form ) {

class.jetpack-cli.php 1 location

@@ 673-679 (lines=7) @@
670
				Jetpack_Sync_Settings::update_settings( $sync_settings );
671
672
				// Convert comma-delimited string of modules to an array
673
				if ( ! empty( $assoc_args['modules'] ) ) {
674
					$modules = array_map( 'trim', explode( ',', $assoc_args['modules'] ) );
675
676
					// Convert the array so that the keys are the module name and the value is true to indicate
677
					// that we want to sync the module
678
					$modules = array_map( '__return_true', array_flip( $modules ) );
679
				}
680
681
				foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) {
682
					if (