Code Duplication    Length = 6-6 lines in 2 locations

src/wp-includes/widgets/class-wp-widget-recent-comments.php 1 location

@@ 135-140 (lines=6) @@
132
	 * @param array $old_instance Old settings for this instance.
133
	 * @return array Updated settings to save.
134
	 */
135
	public function update( $new_instance, $old_instance ) {
136
		$instance = $old_instance;
137
		$instance['title'] = sanitize_text_field( $new_instance['title'] );
138
		$instance['number'] = absint( $new_instance['number'] );
139
		return $instance;
140
	}
141
142
	/**
143
	 * Outputs the settings form for the Recent Comments widget.

src/wp-includes/widgets/class-wp-widget-search.php 1 location

@@ 82-87 (lines=6) @@
79
	 * @param array $old_instance Old settings for this instance.
80
	 * @return array Updated settings.
81
	 */
82
	public function update( $new_instance, $old_instance ) {
83
		$instance = $old_instance;
84
		$new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
85
		$instance['title'] = sanitize_text_field( $new_instance['title'] );
86
		return $instance;
87
	}
88
89
}
90