Parse raw orders.

@param array $rawOrders The raw orders.
@return DataTablesOrderInterface[] Returns the orders.
554696
protected static function parseOrders(array $rawOrders) {

        $dtOrders = [];

        foreach ($rawOrders as $current) {
            $dtOrders[] = static::parseOrder($current);
        }

        return $dtOrders;
    }
417318
private function parseRawlist(array $rawlist)
    {
        $parsed = array();
        foreach ($rawlist as $line) {
            $infos = preg_split("/[\s]+/", $line, 9);

            if ($this->isLinuxListing($infos)) {
                $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]);
                if ('total' !== $infos[0]) {
                    $parsed[] = array(
                        'perms' => $infos[0],
                        'num' => $infos[1],
                        'size' => $infos[4],
                        'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]),
                        'name' => $infos[8],
                    );
                }
            } elseif (count($infos) >= 4) {
                $isDir = (boolean) ('<dir>' === $infos[2]);
                $parsed[] = array(
                    'perms' => $isDir ? 'd' : '-',
                    'num' => '',
                    'size' => $isDir ? '' : $infos[2],
                    'time' => strtotime($infos[0].' '.$infos[1]),
                    'name' => $infos[3],
                );
            }
        }

        return $parsed;
    }
400379
private function parseArgs($rawArgs) {
        if (!is_array($rawArgs)) {
            throw new ServiceContainerException('constructor-args or call argument must be array!');
        }

        if (empty($rawArgs)) {
            return [];
        }

        $args = [];
        foreach ($rawArgs as $rawArg) {
            $args[] = $this->parseArg($rawArg);
        }
        return $args;
    }
442032
public function orderBy(array $orderings) : self
    {
        $this->orderings = array_map(
            static function (string $ordering) : string {
                return strtoupper($ordering) === Criteria::ASC ? Criteria::ASC : Criteria::DESC;
            },
            $orderings
        );

        return $this;
    }
1209206
public function parseDateTime($rawValue) {
		if (null === $rawValue) return null;
		
		try {
			return DateUtils::createDateTimeFromFormat(MssqlDateTimeColumn::generateFormatBuildRawValue(
							MssqlDateTimeColumn::FORMAT_BUILD_TYPE_PARSE, true, true, self::COLUMN_TYPE_PRECISION, false),
					$rawValue);
		} catch (\n2n\util\DateParseException $e) {
			throw new \InvalidArgumentException($e->getMessage(), 0, $e);
		}
	}
440859
public function createApiLogsByOrderIds($orders)
    {
        $ids = [];
        /** @var \Orm\Zed\Sales\Persistence\SpySalesOrder $order */
        foreach ($orders as $order) {
            $ids[] = $order->getIdSalesOrder();
        }

        $query = $this->getFactory()->createPaymentPayoneApiLogQuery()
            ->useSpyPaymentPayoneQuery()
            ->filterByFkSalesOrder($ids, Criteria::IN)
            ->endUse()
            ->orderByCreatedAt();

        return $query;
    }
270169
public function addOrders(Order ...$orders): MutableQuery
    {
        $cloned = clone $this;

        $activeOrders = iterator_to_array($this->orders);
        $activeOrders = array_merge($activeOrders, $orders);

        $cloned->orders = new OrderCollection(...$activeOrders);

        return $cloned;
    }
836372
protected function parseResponse(array $responseRaw = [])
    {
        $result = [];

        if (count($responseRaw) === 0) {
            return $result;
        } elseif (strpos($responseRaw[0], '%PDF-') !== false) {
            return ['rawResponse' => base64_encode(implode("\n", array_values($responseRaw)))];
        }

        foreach ($responseRaw as $key => $line) {
            $pos = strpos($line, '=');

            if ($pos === false) {
                if (strlen($line) > 0) {
                    $result[$key] = $line;
                }
                continue;
            }

            $lineArray = explode('=', $line);
            $resultKey = array_shift($lineArray);
            $result[$resultKey] = implode('=', $lineArray);
        }

        return $result;
    }
319438
public static function parse($raw)
    {
        self::$parsed = [];
        list($headings, $data) = self::parseRawData($raw);

        if (!is_array($headings)) {
            // @codeCoverageIgnoreStart
            return self::$parsed;
            // @codeCoverageIgnoreEnd
        }

        foreach ($headings as $heading) {
            for ($i = 0, $j = count($heading); $i < $j; $i++) {
                self::populateEntries($heading, $data, $i);
            }
        };

        unset($headings, $data);

        return array_reverse(self::$parsed);
    }
1131199
public function parseDefaultSortOrder($defaultSortOrderString)
    {
        switch (strtoupper($defaultSortOrderString)) {
            case 'ASC':
                return Values\Content\Location::SORT_ORDER_ASC;
            case 'DESC':
                return Values\Content\Location::SORT_ORDER_DESC;
        }

        throw new \RuntimeException("Unknown default sort order: '{$defaultSortOrderString}'.");
    }
626994
private function parseResponseHeaders($raw_response_headers)
    {
        $response_header_array = explode("\r\n\r\n", $raw_response_headers);
        $response_header  = '';
        for ($i = count($response_header_array) - 1; $i >= 0; $i--) {
            if (stripos($response_header_array[$i], 'HTTP/') === 0) {
                $response_header = $response_header_array[$i];
                break;
            }
        }

        $response_headers = new CaseInsensitiveArray();
        list($first_line, $headers) = $this->parseHeaders($response_header);
        $response_headers['Status-Line'] = $first_line;
        foreach ($headers as $key => $value) {
            $response_headers[$key] = $value;
        }
        return $response_headers;
    }
582312
private function resolveRawProgresses(array $rawProgresses): array
    {
        static $callbacks;

        $callbacks = $callbacks ?? [
            self::OP_CPY => function (int $x, int $y): array {
                return [self::OP_CPY, $x - 1, $y - 1, 1];
            },
            self::OP_DEL => function (int $x, int $y): array {
                return [self::OP_DEL, $x - 1, $y, 1];
            },
            self::OP_INS => function (int $x, int $y): array {
                return [self::OP_INS, $x, $y - 1, 1];
            },
            self::OP_REP => function (int $x, int $y): array {
                return [self::OP_REP, $x - 1, $y - 1, 1];
            },
        ];

        foreach ($rawProgresses as &$rawProgress) {
            $rawProgress = $callbacks[$rawProgress[2]](
                $rawProgress[0],
                $rawProgress[1]
            );
        }
        unset($rawProgress);

        return $rawProgresses;
    }
1055694
protected static function isValidRawOrder(array $rawOrder) {
        if (false === array_key_exists(DataTablesOrderInterface::DATATABLES_PARAMETER_COLUMN, $rawOrder)) {
            return false;
        }
        if (false === array_key_exists(DataTablesOrderInterface::DATATABLES_PARAMETER_DIR, $rawOrder)) {
            return false;
        }
        return true;
    }
826447
public function getHttpResponseHeaders($rawHeaders)
    {
        if (is_array($rawHeaders)) {
            return $this->parseArrayHeaders($rawHeaders);
        }
        return $this->parseStringHeaders($rawHeaders);
    }
103144
public function getRelationToTable($rawTableName)
    {
        foreach ($this->_relations as $relation) {
            if ($relation->getReferencedTable()->getRawTableName() === $rawTableName) {
                return $relation;
            }
        }
    }
126370
protected function reverseDirection($orders)
	{
		foreach($orders as $column => $direction)
			$orders[$column] = strtolower(trim($direction))==='desc' ? 'ASC' : 'DESC';
		return $orders;
	}
558927
private static function parseRawData($raw)
    {
        $pattern = '/\['.REGEX_DATE_PATTERN.' '.REGEX_TIME_PATTERN.'\].*/';
        preg_match_all($pattern, $raw, $headings);
        $data    = preg_split($pattern, $raw);

        if ($data[0] < 1) {
            $trash = array_shift($data);
            unset($trash);
        }

        return [$headings, $data];
    }