public function sortKeys($order = SORT_ASC, $flags = SORT_REGULAR)
    {
        $this->validateSortArgs($order, $flags);

        $items = $this->items;

        if ($order === SORT_ASC) {
            ksort($items, $flags);
        } else {
            krsort($items, $flags);
        }

        return $this->createFrom($items);
    }