Code Duplication    Length = 16-16 lines in 2 locations

packages/autoloader/src/class-classes-handler.php 1 location

@@ 74-89 (lines=16) @@
71
	/**
72
	 *  Initializes the classmap.
73
	 */
74
	public function set_class_paths() {
75
		$active_plugins_paths = $this->plugins_handler->get_all_active_plugins_paths();
76
		$classmap_paths       = array_map( array( $this, 'create_classmap_path' ), $active_plugins_paths );
77
78
		foreach ( $classmap_paths as $path ) {
79
			if ( is_readable( $path ) ) {
80
				$class_map = require $path;
81
82
				if ( is_array( $class_map ) ) {
83
					foreach ( $class_map as $class_name => $class_info ) {
84
						$this->enqueue_package_class( $class_name, $class_info['version'], $class_info['path'] );
85
					}
86
				}
87
			}
88
		}
89
	}
90
}
91

packages/autoloader/src/class-files-handler.php 1 location

@@ 74-89 (lines=16) @@
71
	/**
72
	 *  Initializes the filemap.
73
	 */
74
	public function set_file_paths() {
75
		$active_plugin_paths = $this->plugins_handler->get_all_active_plugins_paths();
76
		$filemap_paths       = array_map( array( $this, 'create_filemap_path' ), $active_plugin_paths );
77
78
		foreach ( $filemap_paths as $path ) {
79
			if ( is_readable( $path ) ) {
80
				$file_map = require $path;
81
82
				if ( is_array( $file_map ) ) {
83
					foreach ( $file_map as $file_identifier => $file_data ) {
84
						$this->enqueue_package_file( $file_identifier, $file_data['version'], $file_data['path'] );
85
					}
86
				}
87
			}
88
		}
89
	}
90
91
	/**
92
	 * Include latest version of all enqueued files.