Code Duplication    Length = 13-13 lines in 2 locations

projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php 1 location

@@ 294-306 (lines=13) @@
291
	 * @param array $test_data the current test data.
292
	 * @return Boolean does the test pass?
293
	 */
294
	protected function test_preg_match( $test_data ) {
295
		$password = stripslashes( $this->password );
296
297
		if ( isset( $test_data['trim'] ) ) {
298
			$password = substr( $password, 1, -1 );
299
		}
300
301
		if ( ! preg_match( '/' . $test_data['pattern'] . '/u', $password ) ) {
302
			return false;
303
		}
304
305
		return true;
306
	}
307
308
	/**
309
	 * Provides the comparison tester functionality.

projects/packages/password-checker/src/class-password-checker.php 1 location

@@ 302-314 (lines=13) @@
299
	 * @param array $test_data the current test data.
300
	 * @return Boolean does the test pass?
301
	 */
302
	protected function test_preg_match( $test_data ) {
303
		$password = stripslashes( $this->password );
304
305
		if ( isset( $test_data['trim'] ) ) {
306
			$password = substr( $password, 1, -1 );
307
		}
308
309
		if ( ! preg_match( '/' . $test_data['pattern'] . '/u', $password ) ) {
310
			return false;
311
		}
312
313
		return true;
314
	}
315
316
	/**
317
	 * Provides the comparison tester functionality.