Code Duplication    Length = 10-12 lines in 2 locations

includes/auth/AuthManager.php 2 locations

@@ 1203-1212 (lines=10) @@
1200
			$user->load( User::READ_LOCKING );
1201
1202
			if ( $state['userid'] === 0 ) {
1203
				if ( $user->getId() != 0 ) {
1204
					$this->logger->debug( __METHOD__ . ': User exists locally', [
1205
						'user' => $user->getName(),
1206
						'creator' => $creator->getName(),
1207
					] );
1208
					$ret = AuthenticationResponse::newFail( wfMessage( 'userexists' ) );
1209
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1210
					$session->remove( 'AuthManager::accountCreationState' );
1211
					return $ret;
1212
				}
1213
			} else {
1214
				if ( $user->getId() == 0 ) {
1215
					$this->logger->debug( __METHOD__ . ': User does not exist locally when it should', [
@@ 1334-1345 (lines=12) @@
1331
							// @codeCoverageIgnoreEnd
1332
					}
1333
				}
1334
				if ( $state['primary'] === null ) {
1335
					$this->logger->debug( __METHOD__ . ': Primary creation failed because no provider accepted', [
1336
						'user' => $user->getName(),
1337
						'creator' => $creator->getName(),
1338
					] );
1339
					$ret = AuthenticationResponse::newFail(
1340
						wfMessage( 'authmanager-create-no-primary' )
1341
					);
1342
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1343
					$session->remove( 'AuthManager::accountCreationState' );
1344
					return $ret;
1345
				}
1346
			} elseif ( $state['primaryResponse'] === null ) {
1347
				$provider = $this->getAuthenticationProvider( $state['primary'] );
1348
				if ( !$provider instanceof PrimaryAuthenticationProvider ) {