Code Duplication    Length = 7-7 lines in 3 locations

includes/auth/AuthPluginPrimaryAuthenticationProvider.php 1 location

@@ 340-346 (lines=7) @@
337
			$username = User::getCanonicalName( $req->username, 'usable' );
338
			if ( $username !== false ) {
339
				$sv = \StatusValue::newGood();
340
				if ( $req->password !== null ) {
341
					if ( $req->password !== $req->retype ) {
342
						$sv->fatal( 'badretype' );
343
					} else {
344
						$sv->merge( $this->checkPasswordValidity( $username, $req->password ) );
345
					}
346
				}
347
				return $sv;
348
			} else {
349
				return \StatusValue::newGood( 'ignored' );

includes/auth/LocalPasswordPrimaryAuthenticationProvider.php 2 locations

@@ 215-221 (lines=7) @@
212
				);
213
				if ( $row ) {
214
					$sv = \StatusValue::newGood();
215
					if ( $req->password !== null ) {
216
						if ( $req->password !== $req->retype ) {
217
							$sv->fatal( 'badretype' );
218
						} else {
219
							$sv->merge( $this->checkPasswordValidity( $username, $req->password ) );
220
						}
221
					}
222
					return $sv;
223
				}
224
			}
@@ 271-277 (lines=7) @@
268
269
		$ret = \StatusValue::newGood();
270
		if ( !$this->loginOnly && $req && $req->username !== null && $req->password !== null ) {
271
			if ( $req->password !== $req->retype ) {
272
				$ret->fatal( 'badretype' );
273
			} else {
274
				$ret->merge(
275
					$this->checkPasswordValidity( $user->getName(), $req->password )
276
				);
277
			}
278
		}
279
		return $ret;
280
	}