Code Duplication    Length = 13-13 lines in 2 locations

packages/connection/src/Manager.php 2 locations

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