Code Duplication    Length = 3-5 lines in 2 locations

src/wp-admin/includes/class-language-pack-upgrader.php 1 location

@@ 221-223 (lines=3) @@
218
		 * as we then may need to create a /plugins or /themes directory inside of it.
219
		 */
220
		$remote_destination = $wp_filesystem->find_folder( WP_LANG_DIR );
221
		if ( ! $wp_filesystem->exists( $remote_destination ) )
222
			if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) )
223
				return new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination );
224
225
		$language_updates_results = array();
226

src/wp-admin/includes/class-wp-upgrader.php 1 location

@@ 560-564 (lines=5) @@
557
		}
558
559
		//Create destination if needed
560
		if ( ! $wp_filesystem->exists( $remote_destination ) ) {
561
			if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
562
				return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
563
			}
564
		}
565
		// Copy new version of item into place.
566
		$result = copy_dir($source, $remote_destination);
567
		if ( is_wp_error($result) ) {