Code Duplication    Length = 19-19 lines in 2 locations

packages/connection/tests/php/test_Error_Handler.php 1 location

@@ 32-50 (lines=19) @@
29
	 * @param string $user_id The user id you want the token to have.
30
	 * @return \WP_Error
31
	 */
32
	public function get_sample_error( $error_code, $user_id ) {
33
34
		$signature_details = array(
35
			'token'     => 'dhj938djh938d:1:' . $user_id,
36
			'timestamp' => time(),
37
			'nonce'     => 'asd3d32d',
38
			'body_hash' => 'dsf34frf',
39
			'method'    => 'POST',
40
			'url'       => 'https://example.org',
41
			'signature' => 'sdf234fe',
42
		);
43
44
		return new \WP_Error(
45
			$error_code,
46
			'An error was triggered',
47
			compact( 'signature_details' )
48
		);
49
50
	}
51
52
	/**
53
	 * Test storing an error

packages/debug-helper/modules/inc/class-broken-token-xmlrpc.php 1 location

@@ 253-271 (lines=19) @@
250
	 * @param string $user_id The user id you want the token to have.
251
	 * @return \WP_Error
252
	 */
253
	public function get_sample_error( $error_code, $user_id ) {
254
255
		$signature_details = array(
256
			'token'     => 'dhj938djh938d:1:' . $user_id,
257
			'timestamp' => time(),
258
			'nonce'     => 'asd3d32d',
259
			'body_hash' => 'dsf34frf',
260
			'method'    => 'POST',
261
			'url'       => 'https://example.org',
262
			'signature' => 'sdf234fe',
263
		);
264
265
		return new \WP_Error(
266
			$error_code,
267
			'An error was triggered',
268
			compact( 'signature_details' )
269
		);
270
271
	}
272
273
	/**
274
	 * Creates a fake error