Code Duplication    Length = 10-12 lines in 2 locations

includes/auth/AuthManager.php 2 locations

@@ 1158-1167 (lines=10) @@
1155
			$user->load( User::READ_LOCKING );
1156
1157
			if ( $state['userid'] === 0 ) {
1158
				if ( $user->getId() != 0 ) {
1159
					$this->logger->debug( __METHOD__ . ': User exists locally', [
1160
						'user' => $user->getName(),
1161
						'creator' => $creator->getName(),
1162
					] );
1163
					$ret = AuthenticationResponse::newFail( wfMessage( 'userexists' ) );
1164
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1165
					$session->remove( 'AuthManager::accountCreationState' );
1166
					return $ret;
1167
				}
1168
			} else {
1169
				if ( $user->getId() == 0 ) {
1170
					$this->logger->debug( __METHOD__ . ': User does not exist locally when it should', [
@@ 1297-1308 (lines=12) @@
1294
							// @codeCoverageIgnoreEnd
1295
					}
1296
				}
1297
				if ( $state['primary'] === null ) {
1298
					$this->logger->debug( __METHOD__ . ': Primary creation failed because no provider accepted', [
1299
						'user' => $user->getName(),
1300
						'creator' => $creator->getName(),
1301
					] );
1302
					$ret = AuthenticationResponse::newFail(
1303
						wfMessage( 'authmanager-create-no-primary' )
1304
					);
1305
					$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1306
					$session->remove( 'AuthManager::accountCreationState' );
1307
					return $ret;
1308
				}
1309
			} elseif ( $state['primaryResponse'] === null ) {
1310
				$provider = $this->getAuthenticationProvider( $state['primary'] );
1311
				if ( !$provider instanceof PrimaryAuthenticationProvider ) {