<commit_before><?php
namespace Loevgaard\Dandomain\Api\Endpoint;

use Assert\Assert;

class Order extends Endpoint
{
    /**
     * @param \DateTimeInterface $dateStart
     * @param \DateTimeInterface $dateEnd
     * @param int|null $orderStateId
     * @return int
     */
    public function countByModifiedInterval(\DateTimeInterface $dateStart, \DateTimeInterface $dateEnd, int $orderStateId = null) : int
    {
        Assert::that($dateStart)->lessThan($dateEnd, '$dateStart must be before $dateEnd');
        Assert::thatNullOr($orderStateId)->integer('$orderStateId must be an integer');

        $q = sprintf(
            '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/CountByModifiedInterval?start=%s&end=%s',
            $dateStart->format('Y-m-d\TH:i:s'),
            $dateEnd->format('Y-m-d\TH:i:s')
        );

        if ($orderStateId) {
            $q .= sprintf('&orderstateid=%d', $orderStateId);
        }

        return (int)$this->master->doRequest('GET', $q);
    }

    /**
     * @param array|\stdClass $order
     * @return array
     */
    public function createOrder($order) : array
    {
        return (array)$this->master->doRequest('POST', '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}', $order);
    }

    /**
     * @param \DateTimeInterface $dateStart
     * @param \DateTimeInterface $dateEnd
     * @return array
     */
    public function getOrders(\DateTimeInterface $dateStart, \DateTimeInterface $dateEnd) : array
    {
        Assert::that($dateStart)->lessThan($dateEnd, '$dateStart must be before $dateEnd');

        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/GetByDateInterval?start=%s&end=%s',
                $dateStart->format('Y-m-d'),
                $dateEnd->format('Y-m-d')
            )
        );
    }

    /**
     * @param int $orderId
     * @return array
     */
    public function getOrder(int $orderId) : array
    {
        Assert::that($orderId)->greaterThan(0, 'The $orderId has to be positive');

        return (array)$this->master->doRequest('GET', sprintf('/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/%d', $orderId));
    }
<commit_msg>Update getOrders to include TH:i:s<commit_after><?php
namespace Loevgaard\Dandomain\Api\Endpoint;

use Assert\Assert;

class Order extends Endpoint
{
    /**
     * @param \DateTimeInterface $dateStart
     * @param \DateTimeInterface $dateEnd
     * @param int|null $orderStateId
     * @return int
     */
    public function countByModifiedInterval(\DateTimeInterface $dateStart, \DateTimeInterface $dateEnd, int $orderStateId = null) : int
    {
        Assert::that($dateStart)->lessThan($dateEnd, '$dateStart must be before $dateEnd');
        Assert::thatNullOr($orderStateId)->integer('$orderStateId must be an integer');

        $q = sprintf(
            '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/CountByModifiedInterval?start=%s&end=%s',
            $dateStart->format('Y-m-d\TH:i:s'),
            $dateEnd->format('Y-m-d\TH:i:s')
        );

        if ($orderStateId) {
            $q .= sprintf('&orderstateid=%d', $orderStateId);
        }

        return (int)$this->master->doRequest('GET', $q);
    }

    /**
     * @param array|\stdClass $order
     * @return array
     */
    public function createOrder($order) : array
    {
        return (array)$this->master->doRequest('POST', '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}', $order);
    }

    /**
     * @param \DateTimeInterface $dateStart
     * @param \DateTimeInterface $dateEnd
     * @return array
     */
    public function getOrders(\DateTimeInterface $dateStart, \DateTimeInterface $dateEnd) : array
    {
        Assert::that($dateStart)->lessThan($dateEnd, '$dateStart must be before $dateEnd');

        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/GetByDateInterval?start=%s&end=%s',
                $dateStart->format('Y-m-d\TH:i:s'),
                $dateEnd->format('Y-m-d\TH:i:s')
            )
        );
    }

    /**
     * @param int $orderId
     * @return array
     */
    public function getOrder(int $orderId) : array
    {
        Assert::that($orderId)->greaterThan(0, 'The $orderId has to be positive');

        return (array)$this->master->doRequest('GET', sprintf('/admin/WEBAPI/Endpoints/v1_0/OrderService/{KEY}/%d', $orderId));
    }

{'fraction_non_alphanumeric': 0.15710778844008033, 'fraction_numerical': 0.004016960499888418, 'mean_word_length': 2.6174334140435835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7450016', 'n_tokens_mistral': 1391, 'n_tokens_neox': 1376, 'n_words': 236}