Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 1449-1461 (lines=13) @@
1446
		}
1447
1448
		// No .test or .local domains.
1449
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1450
			return new \WP_Error(
1451
				'fail_domain_tld',
1452
				sprintf(
1453
					/* translators: %1$s is a domain name. */
1454
					__(
1455
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1456
						'jetpack'
1457
					),
1458
					$domain
1459
				)
1460
			);
1461
		}
1462
1463
		// No WPCOM subdomains.
1464
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1464-1476 (lines=13) @@
1461
		}
1462
1463
		// No WPCOM subdomains.
1464
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1465
			return new \WP_Error(
1466
				'fail_subdomain_wpcom',
1467
				sprintf(
1468
					/* translators: %1$s is a domain name. */
1469
					__(
1470
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1471
						'jetpack'
1472
					),
1473
					$domain
1474
				)
1475
			);
1476
		}
1477
1478
		// If PHP was compiled without support for the Filter module (very edge case).
1479
		if ( ! function_exists( 'filter_var' ) ) {