Code Duplication    Length = 11-13 lines in 2 locations

includes/auth/AuthManager.php 2 locations

@@ 1187-1197 (lines=11) @@
1184
1185
			// Permissions check
1186
			$status = $this->checkAccountCreatePermissions( $creator );
1187
			if ( !$status->isGood() ) {
1188
				$this->logger->debug( __METHOD__ . ': {creator} cannot create users: {reason}', [
1189
					'user' => $user->getName(),
1190
					'creator' => $creator->getName(),
1191
					'reason' => $status->getWikiText( null, null, 'en' )
1192
				] );
1193
				$ret = AuthenticationResponse::newFail( $status->getMessage() );
1194
				$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1195
				$session->remove( 'AuthManager::accountCreationState' );
1196
				return $ret;
1197
			}
1198
1199
			// Load from master for existence check
1200
			$user->load( User::READ_LOCKING );
@@ 1240-1252 (lines=13) @@
1237
			foreach ( $state['reqs'] as $req ) {
1238
				if ( $req instanceof UserDataAuthenticationRequest ) {
1239
					$status = $req->populateUser( $user );
1240
					if ( !$status->isGood() ) {
1241
						// This should never happen...
1242
						$status = Status::wrap( $status );
1243
						$this->logger->debug( __METHOD__ . ': UserData is invalid: {reason}', [
1244
							'user' => $user->getName(),
1245
							'creator' => $creator->getName(),
1246
							'reason' => $status->getWikiText( null, null, 'en' ),
1247
						] );
1248
						$ret = AuthenticationResponse::newFail( $status->getMessage() );
1249
						$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1250
						$session->remove( 'AuthManager::accountCreationState' );
1251
						return $ret;
1252
					}
1253
				}
1254
			}
1255