Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 316-333 (lines=18) @@
313
	 * @param array $test_data the current test data.
314
	 * @return Boolean does the test pass?
315
	 */
316
	protected function test_compare_to_list( $test_data ) {
317
		$list_callback    = $test_data['list_callback'];
318
		$compare_callback = $test_data['compare_callback'];
319
320
		if (
321
			! is_callable( array( $this, $list_callback ) )
322
			|| ! is_callable( array( $this, $compare_callback ) )
323
		) {
324
			return false;
325
		}
326
327
		$list = call_user_func( array( $this, $list_callback ) );
328
		if ( empty( $list ) ) {
329
			return true;
330
		}
331
332
		return call_user_func( array( $this, $compare_callback ), $this->password, $list );
333
	}
334
335
	/**
336
	 * Getter for the common password list.

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

@@ 314-331 (lines=18) @@
311
	 * @param array $test_data the current test data.
312
	 * @return Boolean does the test pass?
313
	 */
314
	protected function test_compare_to_list( $test_data ) {
315
		$list_callback    = $test_data['list_callback'];
316
		$compare_callback = $test_data['compare_callback'];
317
318
		if (
319
			! is_callable( array( $this, $list_callback ) )
320
			|| ! is_callable( array( $this, $compare_callback ) )
321
		) {
322
			return false;
323
		}
324
325
		$list = call_user_func( array( $this, $list_callback ) );
326
		if ( empty( $list ) ) {
327
			return true;
328
		}
329
330
		return call_user_func( array( $this, $compare_callback ), $this->password, $list );
331
	}
332
333
	/**
334
	 * Getter for the common password list.