Code Duplication    Length = 3-7 lines in 3 locations

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

@@ 3032-3034 (lines=3) @@
3029
		if ( ! empty( $attributes['options'] ) && is_string( $attributes['options'] ) ) {
3030
			$attributes['options'] = array_map( 'trim', explode( ',', $attributes['options'] ) );
3031
3032
			if ( ! empty( $attributes['values'] ) && is_string( $attributes['values'] ) ) {
3033
				$attributes['values'] = array_map( 'trim', explode( ',', $attributes['values'] ) );
3034
			}
3035
		}
3036
3037
		if ( $form ) {

class.jetpack-cli.php 1 location

@@ 924-930 (lines=7) @@
921
				Jetpack_Sync_Settings::update_settings( $sync_settings );
922
923
				// Convert comma-delimited string of modules to an array
924
				if ( ! empty( $assoc_args['modules'] ) ) {
925
					$modules = array_map( 'trim', explode( ',', $assoc_args['modules'] ) );
926
927
					// Convert the array so that the keys are the module name and the value is true to indicate
928
					// that we want to sync the module
929
					$modules = array_map( '__return_true', array_flip( $modules ) );
930
				}
931
932
				foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) {
933
					if (

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

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