Adapter/PlentymarketsAdapter/ResponseParser/Order/OrderResponseParser.php
private function getPackages(array $entry)
    {
        $numbers = $this->client->request('GET', 'orders/' . $entry['id'] . '/packagenumbers');

        $shippingDate = array_filter($entry['dates'], function (array $date) {
            return $date['typeId'] === 8;
        });

        $result = [];
        foreach ($numbers as $number) {
            $package = new Package();
            $package->setShippingCode((string) $number);
            $package->setShippingProvider();

            if (!empty($shippingDate)) {
                $shippingDate = array_shift($shippingDate);

                $package->setShippingTime(DateTimeImmutable::createFromFormat(
                    DATE_ATOM,
                    $shippingDate['date']
                ));
            }

            $result[] = $package;
        }

        return $result;
    }
private function getPackages(array $entry)
    {
        $numbers = $this->client->request('GET', 'orders/' . $entry['id'] . '/packagenumbers');

        $shippingDate = array_filter($entry['dates'], function (array $date) {
            return $date['typeId'] === 8;
        });

        $result = [];
        foreach ($numbers as $number) {
            $package = new Package();
            $package->setShippingCode((string) $number);
            $package->setShippingProvider();

            if (!empty($shippingDate)) {
                $shippingDate = array_shift($shippingDate);

                $package->setShippingTime(DateTimeImmutable::createFromFormat(
                    DATE_ATOM,
                    $shippingDate['date']
                ));
            }

            $result[] = $package;
        }

        return $result;
    }
@param array $entry

@return Package[]