Code Duplication    Length = 3-7 lines in 3 locations

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

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

class.jetpack-cli.php 1 location

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

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

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