Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1041-1048 (lines=8) @@
1038
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1039
				$entity
1040
			);
1041
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1042
			return new \WP_Error(
1043
				'jetpack_id',
1044
				/* translators: %s is an error message string */
1045
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1046
				$entity
1047
			);
1048
		}
1049
1050
		return $registration_response;
1051
	}
@@ 1744-1756 (lines=13) @@
1741
		}
1742
1743
		// No .test or .local domains.
1744
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1745
			return new \WP_Error(
1746
				'fail_domain_tld',
1747
				sprintf(
1748
					/* translators: %1$s is a domain name. */
1749
					__(
1750
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1751
						'jetpack'
1752
					),
1753
					$domain
1754
				)
1755
			);
1756
		}
1757
1758
		// No WPCOM subdomains.
1759
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1759-1771 (lines=13) @@
1756
		}
1757
1758
		// No WPCOM subdomains.
1759
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1760
			return new \WP_Error(
1761
				'fail_subdomain_wpcom',
1762
				sprintf(
1763
					/* translators: %1$s is a domain name. */
1764
					__(
1765
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1766
						'jetpack'
1767
					),
1768
					$domain
1769
				)
1770
			);
1771
		}
1772
1773
		// If PHP was compiled without support for the Filter module (very edge case).
1774
		if ( ! function_exists( 'filter_var' ) ) {