Code Duplication    Length = 8-13 lines in 3 locations

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

@@ 1153-1160 (lines=8) @@
1150
				sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1151
				$entity
1152
			);
1153
		} elseif ( preg_match( '/[^0-9]/', $registration_response->jetpack_id ) ) {
1154
			return new \WP_Error(
1155
				'jetpack_id',
1156
				/* translators: %s is an error message string */
1157
				sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ), $entity ),
1158
				$entity
1159
			);
1160
		}
1161
1162
		return $registration_response;
1163
	}
@@ 1869-1881 (lines=13) @@
1866
		}
1867
1868
		// No .test or .local domains.
1869
		if ( preg_match( '#\.(test|local)$#i', $domain ) ) {
1870
			return new \WP_Error(
1871
				'fail_domain_tld',
1872
				sprintf(
1873
					/* translators: %1$s is a domain name. */
1874
					__(
1875
						'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.',
1876
						'jetpack'
1877
					),
1878
					$domain
1879
				)
1880
			);
1881
		}
1882
1883
		// No WPCOM subdomains.
1884
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
@@ 1884-1896 (lines=13) @@
1881
		}
1882
1883
		// No WPCOM subdomains.
1884
		if ( preg_match( '#\.WordPress\.com$#i', $domain ) ) {
1885
			return new \WP_Error(
1886
				'fail_subdomain_wpcom',
1887
				sprintf(
1888
					/* translators: %1$s is a domain name. */
1889
					__(
1890
						'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.',
1891
						'jetpack'
1892
					),
1893
					$domain
1894
				)
1895
			);
1896
		}
1897
1898
		// If PHP was compiled without support for the Filter module (very edge case).
1899
		if ( ! function_exists( 'filter_var' ) ) {