Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 1430-1442 (lines=13) @@
1427
		}
1428
1429
		// No .test or .local domains.
1430
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1431
			return new \WP_Error(
1432
				'fail_domain_tld',
1433
				sprintf(
1434
					/* translators: %1$s is a domain name. */
1435
					__(
1436
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1437
						'jetpack'
1438
					),
1439
					$domain
1440
				)
1441
			);
1442
		}
1443
1444
		// No WPCOM subdomains.
1445
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1445-1457 (lines=13) @@
1442
		}
1443
1444
		// No WPCOM subdomains.
1445
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1446
			return new \WP_Error(
1447
				'fail_subdomain_wpcom',
1448
				sprintf(
1449
					/* translators: %1$s is a domain name. */
1450
					__(
1451
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1452
						'jetpack'
1453
					),
1454
					$domain
1455
				)
1456
			);
1457
		}
1458
1459
		// If PHP was compiled without support for the Filter module (very edge case).
1460
		if ( ! function_exists( 'filter_var' ) ) {