Code Duplication    Length = 13-13 lines in 2 locations

core/helpers/EEH_File.helper.php 2 locations

@@ 214-226 (lines=13) @@
211
			if(	! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) {
212
				return false;
213
			}
214
			if ( ! EEH_File::verify_is_writable( $parent_folder, 'folder' )) {
215
				return false;
216
			} else {
217
				if ( ! $wp_filesystem->mkdir( EEH_File::convert_local_filepath_to_remote_filepath(  $folder ) ) ) {
218
					if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
219
						$msg = sprintf( __( '"%s" could not be created.', 'event_espresso' ), $folder );
220
						$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $folder );
221
						throw new EE_Error( $msg );
222
					}
223
					return false;
224
				}
225
				EEH_File::add_htaccess_deny_from_all( $folder );
226
			}
227
		} elseif ( ! EEH_File::verify_is_writable( $folder, 'folder' )) {
228
			return false;
229
		}
@@ 272-284 (lines=13) @@
269
		$wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path );
270
		$full_file_path = EEH_File::standardise_directory_separators( $full_file_path );
271
		$parent_folder = EEH_File::get_parent_folder( $full_file_path );
272
		if ( ! EEH_File::exists( $full_file_path )) {
273
			if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) {
274
				return false;
275
			}
276
			if ( ! $wp_filesystem->touch( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ) {
277
				if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
278
					$msg = sprintf( __( 'The "%s" file could not be created.', 'event_espresso' ), $full_file_path );
279
					$msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path );
280
					throw new EE_Error( $msg );
281
				}
282
				return false;
283
			}
284
		}
285
		if ( ! EEH_File::verify_is_writable( $full_file_path, 'file' )) {
286
			return false;
287
		}