Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1009-1016 (lines=8) @@
1006
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1007
				$entity
1008
			);
1009
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1010
			return new \WP_Error(
1011
				'jetpack_id',
1012
				/* translators: %s is an error message string */
1013
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1014
				$entity
1015
			);
1016
		}
1017
1018
		return $registration_response;
1019
	}
@@ 1924-1936 (lines=13) @@
1921
		}
1922
1923
		// No .test or .local domains.
1924
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1925
			return new \WP_Error(
1926
				'fail_domain_tld',
1927
				sprintf(
1928
					/* translators: %1$s is a domain name. */
1929
					__(
1930
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1931
						'jetpack'
1932
					),
1933
					$domain
1934
				)
1935
			);
1936
		}
1937
1938
		// No WPCOM subdomains.
1939
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1939-1951 (lines=13) @@
1936
		}
1937
1938
		// No WPCOM subdomains.
1939
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1940
			return new \WP_Error(
1941
				'fail_subdomain_wpcom',
1942
				sprintf(
1943
					/* translators: %1$s is a domain name. */
1944
					__(
1945
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1946
						'jetpack'
1947
					),
1948
					$domain
1949
				)
1950
			);
1951
		}
1952
1953
		// If PHP was compiled without support for the Filter module (very edge case).
1954
		if ( ! function_exists( 'filter_var' ) ) {