Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1055-1062 (lines=8) @@
1052
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1053
				$entity
1054
			);
1055
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1056
			return new \WP_Error(
1057
				'jetpack_id',
1058
				/* translators: %s is an error message string */
1059
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1060
				$entity
1061
			);
1062
		}
1063
1064
		return $registration_response;
1065
	}
@@ 1763-1775 (lines=13) @@
1760
		}
1761
1762
		// No .test or .local domains.
1763
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1764
			return new \WP_Error(
1765
				'fail_domain_tld',
1766
				sprintf(
1767
					/* translators: %1$s is a domain name. */
1768
					__(
1769
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1770
						'jetpack'
1771
					),
1772
					$domain
1773
				)
1774
			);
1775
		}
1776
1777
		// No WPCOM subdomains.
1778
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1778-1790 (lines=13) @@
1775
		}
1776
1777
		// No WPCOM subdomains.
1778
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1779
			return new \WP_Error(
1780
				'fail_subdomain_wpcom',
1781
				sprintf(
1782
					/* translators: %1$s is a domain name. */
1783
					__(
1784
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1785
						'jetpack'
1786
					),
1787
					$domain
1788
				)
1789
			);
1790
		}
1791
1792
		// If PHP was compiled without support for the Filter module (very edge case).
1793
		if ( ! function_exists( 'filter_var' ) ) {