Code Duplication    Length = 6-6 lines in 2 locations

tools/import-translations.php 2 locations

@@ 94-99 (lines=6) @@
91
	CURLOPT_COOKIEJAR  => $cookie_jar_file, // write cookies
92
	CURLOPT_RETURNTRANSFER => true,
93
	CURLOPT_HEADER => false,
94
	CURLOPT_HEADERFUNCTION => function( $curl, $header_line ) use ( &$login_error ) {
95
		if ( preg_match( '/_gp_notice_error=/', $header_line, $matches ) ) {
96
			$login_error = true;
97
		}
98
		return strlen( $header_line );
99
	},
100
) );
101
102
curl_exec( $login );
@@ 178-183 (lines=6) @@
175
		),
176
		CURLOPT_RETURNTRANSFER => true,
177
		CURLOPT_HEADER => false,
178
		CURLOPT_HEADERFUNCTION => function( $curl, $header_line ) use ( &$translations_added ) {
179
			if ( preg_match( '/_gp_notice_notice=(\d+)/', $header_line, $matches ) ) {
180
				$translations_added = (int) $matches[1];
181
			}
182
			return strlen( $header_line );
183
		},
184
	) );
185
186
	curl_exec( $import );