Code Duplication    Length = 8-13 lines in 3 locations

projects/packages/connection/src/class-manager.php 3 locations

@@ 1022-1029 (lines=8) @@
1019
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1020
				$entity
1021
			);
1022
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1023
			return new \WP_Error(
1024
				'jetpack_id',
1025
				/* translators: %s is an error message string */
1026
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1027
				$entity
1028
			);
1029
		}
1030
1031
		return $registration_response;
1032
	}
@@ 1749-1761 (lines=13) @@
1746
		}
1747
1748
		// No .test or .local domains.
1749
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1750
			return new \WP_Error(
1751
				'fail_domain_tld',
1752
				sprintf(
1753
					/* translators: %1$s is a domain name. */
1754
					__(
1755
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1756
						'jetpack'
1757
					),
1758
					$domain
1759
				)
1760
			);
1761
		}
1762
1763
		// No WPCOM subdomains.
1764
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1764-1776 (lines=13) @@
1761
		}
1762
1763
		// No WPCOM subdomains.
1764
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1765
			return new \WP_Error(
1766
				'fail_subdomain_wpcom',
1767
				sprintf(
1768
					/* translators: %1$s is a domain name. */
1769
					__(
1770
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1771
						'jetpack'
1772
					),
1773
					$domain
1774
				)
1775
			);
1776
		}
1777
1778
		// If PHP was compiled without support for the Filter module (very edge case).
1779
		if ( ! function_exists( 'filter_var' ) ) {