src/XdrModel/ManageOfferResult.php
public static function fromXdr(XdrBuffer $xdr)
    {
        $model = new ManageOfferResult();

        $rawErrorCode = $xdr->readInteger();
        $errorCodeMap = [
            '0' => 'success',
            '-1' => static::MALFORMED,
            '-2' => static::SELL_NO_TRUST,
            '-3' => static::BUY_NO_TRUST,
            '-4' => static::SELL_NOT_AUTHORIZED,
            '-5' => static::BUY_NOT_AUTHORIZED,
            '-6' => static::LINE_FULL,
            '-7' => static::UNDERFUNDED,
            '-8' => static::CROSS_SELF,
            '-9' => static::SELL_NO_ISSUER,
            '-10' => static::BUY_NO_ISSUER,
            '-11' => static::NOT_FOUND,
            '-12' => static::LOW_RESERVE,
        ];
        if (!isset($errorCodeMap[$rawErrorCode])) {
            throw new \ErrorException(sprintf('Unknown error code %s', $rawErrorCode));
        }

        // Do not store the "success" error code
        if ($errorCodeMap[$rawErrorCode] !== 'success') {
            $model->errorCode = $errorCodeMap[$rawErrorCode];
            // Return immediately if there was an error since there won't be any additional data
            return $model;
        }

        // Populate claimed offers
        $numOffersClaimed = $xdr->readInteger();
        for ($i=0; $i < $numOffersClaimed; $i++) {
            $model->claimedOffers[] = ClaimOfferAtom::fromXdr($xdr);
        }

        $effect = $xdr->readInteger();
        if ($effect === static::EFFECT_CREATED || $effect === static::EFFECT_UPDATED) {
            $model->offer = OfferEntry::fromXdr($xdr);
        }

        return $model;
    }
public static function fromXdr(XdrBuffer $xdr)
    {
        $model = new ManageOfferResult();

        $rawErrorCode = $xdr->readInteger();
        $errorCodeMap = [
            '0' => 'success',
            '-1' => static::MALFORMED,
            '-2' => static::SELL_NO_TRUST,
            '-3' => static::BUY_NO_TRUST,
            '-4' => static::SELL_NOT_AUTHORIZED,
            '-5' => static::BUY_NOT_AUTHORIZED,
            '-6' => static::LINE_FULL,
            '-7' => static::UNDERFUNDED,
            '-8' => static::CROSS_SELF,
            '-9' => static::SELL_NO_ISSUER,
            '-10' => static::BUY_NO_ISSUER,
            '-11' => static::NOT_FOUND,
            '-12' => static::LOW_RESERVE,
        ];
        if (!isset($errorCodeMap[$rawErrorCode])) {
            throw new \ErrorException(sprintf('Unknown error code %s', $rawErrorCode));
        }

        // Do not store the "success" error code
        if ($errorCodeMap[$rawErrorCode] !== 'success') {
            $model->errorCode = $errorCodeMap[$rawErrorCode];
            // Return immediately if there was an error since there won't be any additional data
            return $model;
        }

        // Populate claimed offers
        $numOffersClaimed = $xdr->readInteger();
        for ($i=0; $i < $numOffersClaimed; $i++) {
            $model->claimedOffers[] = ClaimOfferAtom::fromXdr($xdr);
        }

        $effect = $xdr->readInteger();
        if ($effect === static::EFFECT_CREATED || $effect === static::EFFECT_UPDATED) {
            $model->offer = OfferEntry::fromXdr($xdr);
        }

        return $model;
    }
@deprecated Do not call this method directly. Instead, use OperationResult::fromXdr

@param XdrBuffer $xdr
@return OperationResult|PaymentResult
@throws \ErrorException