Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 42-57 (lines=16) @@
39
	 * @param string $version Version of the class.
40
	 * @param string $path Absolute path to the class so that we can load it.
41
	 */
42
	public function enqueue_package_class( $class_name, $version, $path ) {
43
		global $jetpack_packages_classmap;
44
45
		if ( isset( $jetpack_packages_classmap[ $class_name ]['version'] ) ) {
46
			$selected_version = $jetpack_packages_classmap[ $class_name ]['version'];
47
		} else {
48
			$selected_version = null;
49
		}
50
51
		if ( $this->version_selector->is_version_update_required( $selected_version, $version ) ) {
52
			$jetpack_packages_classmap[ $class_name ] = array(
53
				'version' => $version,
54
				'path'    => $path,
55
			);
56
		}
57
	}
58
59
	/**
60
	 * Creates an array containing paths to the plugins' classmaps. The classmap filename is the filename

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

@@ 42-57 (lines=16) @@
39
	 * @param string $version Version of the file.
40
	 * @param string $path Absolute path to the file so that we can load it.
41
	 */
42
	public function enqueue_package_file( $file_identifier, $version, $path ) {
43
		global $jetpack_packages_filemap;
44
45
		if ( isset( $jetpack_packages_filemap[ $file_identifier ]['version'] ) ) {
46
			$selected_version = $jetpack_packages_filemap[ $file_identifier ]['version'];
47
		} else {
48
			$selected_version = null;
49
		}
50
51
		if ( $this->version_selector->is_version_update_required( $selected_version, $version ) ) {
52
			$jetpack_packages_filemap[ $file_identifier ] = array(
53
				'version' => $version,
54
				'path'    => $path,
55
			);
56
		}
57
	}
58
59
	/**
60
	 * Creates an array containing the paths to the plugins' filemaps. The filemap filename is the filename