Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

@@ 1389-1401 (lines=13) @@
1386
		}
1387
1388
		// No .test or .local domains.
1389
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1390
			return new \WP_Error(
1391
				'fail_domain_tld',
1392
				sprintf(
1393
					/* translators: %1$s is a domain name. */
1394
					__(
1395
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1396
						'jetpack'
1397
					),
1398
					$domain
1399
				)
1400
			);
1401
		}
1402
1403
		// No WPCOM subdomains.
1404
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1404-1416 (lines=13) @@
1401
		}
1402
1403
		// No WPCOM subdomains.
1404
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1405
			return new \WP_Error(
1406
				'fail_subdomain_wpcom',
1407
				sprintf(
1408
					/* translators: %1$s is a domain name. */
1409
					__(
1410
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1411
						'jetpack'
1412
					),
1413
					$domain
1414
				)
1415
			);
1416
		}
1417
1418
		// If PHP was compiled without support for the Filter module (very edge case).
1419
		if ( ! function_exists( 'filter_var' ) ) {