Code Duplication    Length = 3-7 lines in 3 locations

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

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

class.jetpack-cli.php 1 location

@@ 936-942 (lines=7) @@
933
				Settings::update_settings( $sync_settings );
934
935
				// Convert comma-delimited string of modules to an array
936
				if ( ! empty( $assoc_args['modules'] ) ) {
937
					$modules = array_map( 'trim', explode( ',', $assoc_args['modules'] ) );
938
939
					// Convert the array so that the keys are the module name and the value is true to indicate
940
					// that we want to sync the module
941
					$modules = array_map( '__return_true', array_flip( $modules ) );
942
				}
943
944
				foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) {
945
					if (

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

@@ 3084-3086 (lines=3) @@
3081
		if ( ! empty( $attributes['options'] ) && is_string( $attributes['options'] ) ) {
3082
			$attributes['options'] = array_map( 'trim', explode( ',', $attributes['options'] ) );
3083
3084
			if ( ! empty( $attributes['values'] ) && is_string( $attributes['values'] ) ) {
3085
				$attributes['values'] = array_map( 'trim', explode( ',', $attributes['values'] ) );
3086
			}
3087
		}
3088
3089
		if ( $form ) {