@param PendingTransportOperations $transportOperations

@return OutboxTransportOperation[]
480610
public function convertToOutboxOperations(PendingTransportOperations $transportOperations)
    {
        $outboxOperations = [];
        foreach ($transportOperations->getOperations() as $operation) {
            $outboxOperations[] = $this->outboxOperationFactory->create(
                $operation->getMessage(),
                $this->serializeAddressTag($operation->getAddressTag())
            );
        }

        return $outboxOperations;
    }
1333842
public function updateWithTransport($transport)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        /** @noinspection PhpUndefinedMethodInspection */
        $this
            ->setSubject($transport->getMessage()->getSubject())
            ->setMessage($transport->getMessage())
            ->setRecipients($transport->getMessage()->getRecipients())
            ->setId(null);

        return $this;
    }
495153
protected function _getPortableSequencesList($sequences)
    {
        $list = [];

        foreach ($sequences as $value) {
            $list[] = $this->_getPortableSequenceDefinition($value);
        }

        return $list;
    }
295112
private function getDynamicRouteIds(array $segments): array
    {
        $matched = [];
        $index = 0;

        do {
            $matched[] =
                $this->provider->getRoutesBySegmentValue($index, $segments[$index]) +
                $this->provider->getRoutesBySegmentValue($index, RouteDefinition::DYNAMIC_SEGMENT);
            $index++;
        } while (isset($segments[$index]));

        $matched[] = $this->provider->getRoutesBySegmentCount(\count($segments));

        return array_values(array_intersect_key(... $matched));
    }
77919
public function getModifiedOrdersToImport($storeIds, $limit, $orderStatuses)
    {
        $collection = $this->addFieldToFilter('store_id', ['in' => $storeIds])
            ->addFieldToFilter('order_status', ['in' => $orderStatuses])
            ->addFieldToFilter('email_imported', '1')
            ->addFieldToFilter('modified', '1');

        $collection->getSelect()->limit($limit);

        return $collection;
    }
563496
public function determineDomainsToImport(ExportCommand $exportCommand)
    {
        if ($exportCommand->getDomains() === false) {
            return [];
        }

        return $this->parseRequestedDomains($exportCommand->getDomains());
    }
192691
protected function getOperationAsArray(FetcherOperation $operation)
    {
        $filters = array();

        if ($operation instanceof SimpleOperation) {
            $filters = $this->addSimpleOperation($operation);
        } else if ($operation instanceof ListOperation) {
            $operations = $operation->getOperations();

            if ($operation->getOperator() === Fetcher::OPERATOR_OR) {
                $filters['$or'] = array_map(
                    function (FetcherOperation $operation) {
                        return $this->getOperationAsArray($operation);
                    },
                    $operations
                );
            } else {
                foreach ($operations as $currentOperation) {
                    $currentFilters = $this->getOperationAsArray($currentOperation);
                    $filters = array_merge_recursive($filters, $currentFilters);
                }
            }
        } else {
            throw new \InvalidArgumentException('Given operation is not supported');
        }

        return $filters;
    }
528359
protected function getAppropriateTransport($flags)
    {
        if ($flags & ApiRequestOption::NO_RESPONSE) {
            $transport = $this->getAsyncTransport();
            if (is_null($transport)) {
                $transport = $this->getTransport();
            } else {
                $fallback = $this->getTransport();
                if ($fallback) {
                    $this->setFallbackTransport($fallback);
                }
            }
        } else {
            $transport = $this->getTransport();
        }

        return $transport;
    }
454439
protected function prepareOrderShipment(OrderTransfer $orderTransfer, AbstractRequestContainer $container): AbstractRequestContainer
    {
        $arrayIt = $container->getIt() ?? [];
        $arrayId = $container->getId() ?? [];
        $arrayPr = $container->getPr() ?? [];
        $arrayNo = $container->getNo() ?? [];
        $arrayDe = $container->getDe() ?? [];
        $arrayVa = $container->getVa() ?? [];

        $key = count($arrayId) + 1;
        $expenses = $orderTransfer->getExpenses();

        $arrayIt[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_SHIPMENT;
        $arrayId[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_SHIPMENT;
        $arrayPr[$key] = $this->getDeliveryCosts($expenses);
        $arrayNo[$key] = 1;
        $arrayDe[$key] = 'Shipment';

        $container->setIt($arrayIt);
        $container->setId($arrayId);
        $container->setPr($arrayPr);
        $container->setNo($arrayNo);
        $container->setDe($arrayDe);
        $container->setVa($arrayVa);

        return $container;
    }
324756
public function send(RequestInterface $request, array $options = [])
    {
        try {
            return $this->client->send($request, $options);
        } catch (TransferException $e) {
            throw new TransportException($e->getMessage(), $e->getCode(), $e);
        }
    }
745437
private function getRangeData(ShippingMethodCost $cost)
    {
        return [
            'min'   => $cost->getRangeFrom(),
            'max'   => $cost->getRangeTo(),
            'price' => $cost->getCost()->getGrossAmount(),
        ];
    }
1045210
public void introduceServiceToTransports(Iterator<? extends BindingDescriptorRegistrationListener> transports) {
        while (transports.hasNext()) {
            BindingDescriptorRegistrationListener t = transports.next();
            boolean eventTransport = t instanceof EventTransport;
            boolean includedEventTransport = false;
            if (eventTransport) {
                // if it's an event transport then we only want to notify if we've been told that the developer wanted to
                // bind to this particular transport (since you can have >1 instance of the event transport currently)
                if (eventTransports != null && eventTransports.contains(t)) {
                    includedEventTransport = true;
                }
            }
            if (!eventTransport || includedEventTransport) {
                for (BindingDescriptor bindingDescriptor : getBindingDescriptors()) {
                    t.notify(bindingDescriptor);
                }
            }
        }
    }
1234064
protected function mergeTransportResult(ResultContract $transportResult, ResultContract $mailerResult)
    {
        if (!$mailerResult instanceof SendResult) {
            throw new InvalidArgumentException('mergeTransportResult can only merge Ems\Mail\SendResult');
        }

        $mailerResult->increment(count($transportResult));

        foreach ($transportResult->failures() as $i => $failed) {
            $mailerResult->addFailedRecipient($failed, $transportResult->error($i));
        }
    }
363388
public function getTransport()
    {
        if (! $this->_transport instanceof LibBaseDispatcherResponseTransportAbstract) {

            if (! ($this->_transport instanceof AnServiceIdentifier)) {
                $this->setTransport($this->_transport);
            }

            $config = array(
                 'response' => $this,
            );

            $this->_transport = $this->getService($this->_transport, $config);
        }

        return $this->_transport;
    }
607310
function getOperations($portName = '', $bindingType = 'soap')
    {
        $ops = [];
        if ($bindingType == 'soap') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
        } elseif ($bindingType == 'soap12') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
        } else {
            $this->debug("getOperations bindingType $bindingType may not be supported");
        }
        $this->debug("getOperations for port '$portName' bindingType $bindingType");
        // loop thru ports
        foreach ($this->ports as $port => $portData) {
            $this->debug("getOperations checking port $port bindingType " . $portData['bindingType']);
            if ($portName == '' || $port == $portName) {
                // binding type of port matches parameter
                if ($portData['bindingType'] == $bindingType) {
                    $this->debug("getOperations found port $port bindingType $bindingType");
                    //$this->debug("port data: " . $this->varDump($portData));
                    //$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
                    // merge bindings
                    if (isset($this->bindings[$portData['binding']]['operations'])) {
                        $ops = array_merge($ops, $this->bindings[$portData['binding']]['operations']);
                    }
                }
            }
        }
        if (count($ops) == 0) {
            $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType");
        }

        return $ops;
    }
1274387
public function getOperations()
    {
        $result = [];
        foreach ($this->definition['operations'] as $name => $definition) {
            $result[$name] = $this->getOperation($name);
        }

        return $result;
    }
874120
public function getFormatsFromOperation(string $resourceClass, string $operationName, string $operationType): array
    {
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

        if (!$formats = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'formats', [], true)) {
            return $this->configuredFormats;
        }

        if (!\is_array($formats)) {
            throw new InvalidArgumentException(sprintf("The 'formats' attributes must be an array, %s given for resource class '%s'.", \gettype($formats), $resourceClass));
        }

        return $this->getOperationFormats($formats);
    }