Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 1327-1339 (lines=13) @@
1324
		}
1325
1326
		// No .test or .local domains.
1327
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1328
			return new \WP_Error(
1329
				'fail_domain_tld',
1330
				sprintf(
1331
					/* translators: %1$s is a domain name. */
1332
					__(
1333
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1334
						'jetpack'
1335
					),
1336
					$domain
1337
				)
1338
			);
1339
		}
1340
1341
		// No WPCOM subdomains.
1342
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1342-1354 (lines=13) @@
1339
		}
1340
1341
		// No WPCOM subdomains.
1342
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1343
			return new \WP_Error(
1344
				'fail_subdomain_wpcom',
1345
				sprintf(
1346
					/* translators: %1$s is a domain name. */
1347
					__(
1348
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1349
						'jetpack'
1350
					),
1351
					$domain
1352
				)
1353
			);
1354
		}
1355
1356
		// If PHP was compiled without support for the Filter module (very edge case).
1357
		if ( ! function_exists( 'filter_var' ) ) {