Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 104-119 (lines=16) @@
101
		 */
102
		$this->common_passwords = apply_filters( 'jetpack_password_checker_restricted_strings', array() );
103
104
		if ( is_null( $user ) ) {
105
			$this->user_id = get_current_user_id();
106
		} elseif ( is_object( $user ) && isset( $user->ID ) ) {
107
108
			// Existing user, using their ID.
109
			$this->user_id = $user->ID;
110
111
		} elseif ( is_object( $user ) ) {
112
113
			// Newly created user, using existing data.
114
			$this->user    = $user;
115
			$this->user_id = 'new_user';
116
117
		} else {
118
			$this->user_id = $user;
119
		}
120
		$this->min_password_length = apply_filters( 'better_password_min_length', $this->min_password_length );
121
	}
122

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

@@ 92-107 (lines=16) @@
89
	 * @param mixed $user can be an integer ID, or a WP_User object.
90
	 */
91
	public function __construct( $user = null ) {
92
		if ( is_null( $user ) ) {
93
			$this->user_id = get_current_user_id();
94
		} elseif ( is_object( $user ) && isset( $user->ID ) ) {
95
			// Existing user, using their ID.
96
			$this->user_id = $user->ID;
97
		} elseif ( is_object( $user ) ) {
98
			// Newly created user, using existing data.
99
			$this->user    = $user;
100
			$this->user_id = 'new_user';
101
		} else {
102
			$this->user_id = $user;
103
		}
104
105
		/**
106
		 * Filters the password strength enforcement settings.
107
		 *
108
		 * You can supply your own passwords that should not be used for authenticating in addition to weak and easy
109
		 * to guess strings for each user. For example, you can add passwords from known password databases to avoid
110
		 * compromised password usage.