Code Duplication    Length = 10-12 lines in 2 locations

includes/auth/AuthManager.php 2 locations

@@ 1149-1158 (lines=10) @@
1146
			$user->load( User::READ_LOCKING );
1147
1148
			if ( $state['userid'] === 0 ) {
1149
				if ( $user->getId() != 0 ) {
1150
					$this->logger->debug( __METHOD__ . ': User exists locally', [
1151
						'user' => $user->getName(),
1152
						'creator' => $creator->getName(),
1153
					] );
1154
					$ret = AuthenticationResponse::newFail( wfMessage( 'userexists' ) );
1155
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1156
					$session->remove( 'AuthManager::accountCreationState' );
1157
					return $ret;
1158
				}
1159
			} else {
1160
				if ( $user->getId() == 0 ) {
1161
					$this->logger->debug( __METHOD__ . ': User does not exist locally when it should', [
@@ 1280-1291 (lines=12) @@
1277
							// @codeCoverageIgnoreEnd
1278
					}
1279
				}
1280
				if ( $state['primary'] === null ) {
1281
					$this->logger->debug( __METHOD__ . ': Primary creation failed because no provider accepted', [
1282
						'user' => $user->getName(),
1283
						'creator' => $creator->getName(),
1284
					] );
1285
					$ret = AuthenticationResponse::newFail(
1286
						wfMessage( 'authmanager-create-no-primary' )
1287
					);
1288
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1289
					$session->remove( 'AuthManager::accountCreationState' );
1290
					return $ret;
1291
				}
1292
			} elseif ( $state['primaryResponse'] === null ) {
1293
				$provider = $this->getAuthenticationProvider( $state['primary'] );
1294
				if ( !$provider instanceof PrimaryAuthenticationProvider ) {