Code Duplication    Length = 16-16 lines in 2 locations

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

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

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

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