Code Duplication    Length = 15-15 lines in 2 locations

includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php 1 location

@@ 190-204 (lines=15) @@
187
		return true;
188
	}
189
190
	public function testUserExists( $username, $flags = User::READ_NORMAL ) {
191
		$username = User::getCanonicalName( $username, 'usable' );
192
		if ( $username === false ) {
193
			return false;
194
		}
195
196
		list( $db, $options ) = \DBAccessObjectUtils::getDBOptions( $flags );
197
		return (bool)wfGetDB( $db )->selectField(
198
			[ 'user' ],
199
			[ 'user_id' ],
200
			[ 'user_name' => $username ],
201
			__METHOD__,
202
			$options
203
		);
204
	}
205
206
	public function providerAllowsAuthenticationDataChange(
207
		AuthenticationRequest $req, $checkData = true

includes/auth/LocalPasswordPrimaryAuthenticationProvider.php 1 location

@@ 182-196 (lines=15) @@
179
		return !$this->getPassword( $row->user_password ) instanceof \InvalidPassword;
180
	}
181
182
	public function testUserExists( $username, $flags = User::READ_NORMAL ) {
183
		$username = User::getCanonicalName( $username, 'usable' );
184
		if ( $username === false ) {
185
			return false;
186
		}
187
188
		list( $db, $options ) = \DBAccessObjectUtils::getDBOptions( $flags );
189
		return (bool)wfGetDB( $db )->selectField(
190
			[ 'user' ],
191
			[ 'user_id' ],
192
			[ 'user_name' => $username ],
193
			__METHOD__,
194
			$options
195
		);
196
	}
197
198
	public function providerAllowsAuthenticationDataChange(
199
		AuthenticationRequest $req, $checkData = true