<commit_before><?php

namespace Norm\Controller;

use \Bono\Controller\RestController;
use \Norm\Norm;

class NormController extends RestController
{

    protected $collection;

    public function __construct($app, $uri)
    {
        parent::__construct($app, $uri);

        $this->collection = Norm::factory($this->clazz);
    }

    public function getCriteria()
    {
        $gets = $this->request->get();

        $criteria = array();
        foreach ($gets as $key => $value) {
            if ($key[0] !== '!') {
                $criteria[$key] = $value;
            }
        }
        return $criteria;
    }

    public function getSort()
    {
        $sorts = $get = $this->request->get('!sort') ?: array();
        foreach ($sorts as $key => &$value) {
            $value = (int) $value;
        }
        return $sorts;
    }

    public function getSkip()
    {
        $skip = $this->request->get('!skip') ?: null;
        return $skip;
    }

    public function getLimit()
    {
        $limit = $this->request->get('!limit') ?:
            isset($this->collection->options['limit'])
                ? $this->collection->options['limit']
                : null;<commit_msg>fixed norm controller limit<commit_after><?php

namespace Norm\Controller;

use \Bono\Controller\RestController;
use \Norm\Norm;

class NormController extends RestController
{

    protected $collection;

    public function __construct($app, $uri)
    {
        parent::__construct($app, $uri);

        $this->collection = Norm::factory($this->clazz);
    }

    public function getCriteria()
    {
        $gets = $this->request->get();

        $criteria = array();
        foreach ($gets as $key => $value) {
            if ($key[0] !== '!') {
                $criteria[$key] = $value;
            }
        }
        return $criteria;
    }

    public function getSort()
    {
        $sorts = $get = $this->request->get('!sort') ?: array();
        foreach ($sorts as $key => &$value) {
            $value = (int) $value;
        }
        return $sorts;
    }

    public function getSkip()
    {
        $skip = $this->request->get('!skip') ?: null;
        return $skip;
    }

    public function getLimit()
    {
        $limit = $this->request->get('!limit');

        if (!isset($limit) && isset($this->collection->options['limit'])) {
            $limit = $this->collection->options['limit'];
        }

{'fraction_non_alphanumeric': 0.1661831744716121, 'fraction_numerical': 0.0008288437629506838, 'mean_word_length': 2.013732833957553, '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': '396416', 'n_tokens_mistral': 726, 'n_tokens_neox': 704, 'n_words': 148}