Code Duplication    Length = 11-13 lines in 2 locations

includes/auth/AuthManager.php 2 locations

@@ 1133-1143 (lines=11) @@
1130
1131
			// Permissions check
1132
			$status = $this->checkAccountCreatePermissions( $creator );
1133
			if ( !$status->isGood() ) {
1134
				$this->logger->debug( __METHOD__ . ': {creator} cannot create users: {reason}', [
1135
					'user' => $user->getName(),
1136
					'creator' => $creator->getName(),
1137
					'reason' => $status->getWikiText( null, null, 'en' )
1138
				] );
1139
				$ret = AuthenticationResponse::newFail( $status->getMessage() );
1140
				$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1141
				$session->remove( 'AuthManager::accountCreationState' );
1142
				return $ret;
1143
			}
1144
1145
			// Load from master for existence check
1146
			$user->load( User::READ_LOCKING );
@@ 1186-1198 (lines=13) @@
1183
			foreach ( $state['reqs'] as $req ) {
1184
				if ( $req instanceof UserDataAuthenticationRequest ) {
1185
					$status = $req->populateUser( $user );
1186
					if ( !$status->isGood() ) {
1187
						// This should never happen...
1188
						$status = Status::wrap( $status );
1189
						$this->logger->debug( __METHOD__ . ': UserData is invalid: {reason}', [
1190
							'user' => $user->getName(),
1191
							'creator' => $creator->getName(),
1192
							'reason' => $status->getWikiText( null, null, 'en' ),
1193
						] );
1194
						$ret = AuthenticationResponse::newFail( $status->getMessage() );
1195
						$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
1196
						$session->remove( 'AuthManager::accountCreationState' );
1197
						return $ret;
1198
					}
1199
				}
1200
			}
1201