<commit_before><?php

namespace Phive\Queue;

class QueueUtils
{
    private function __construct()
    {
    }

    /**
     * @param \DateTime|string|int|null $eta
     *
     * @return int The Unix timestamp.
     *
     * @throws \InvalidArgumentException
     */
    public static function normalizeEta($eta)
    {
        if (null === $eta) {
            return time();
        }
        if (is_string($eta)) {
            $eta = date_create($eta);
        }
        if ($eta instanceof \DateTime) {
            return $eta->getTimestamp();
        }
        if (is_int($eta)) {
            return $eta;
        }

        throw new \InvalidArgumentException('Parameter "eta" must be a string, integer or \DateTime instance.');
    }

    /**
     * @param mixed $value
     *
     * @return int
     */
    public static function normalizeLimit($value)
    {
        return self::normalizeNumber($value, 1, 'limit');
    }

    /**
     * @param mixed $value
     *
     * @return int
     */
    public static function normalizeOffset($value)
    {
        return self::normalizeNumber($value, 0, 'offset');
    }

    /**
     * @param mixed  $number
     * @param int    $min
     * @param string $name
     *
     * @throws \InvalidArgumentException|\OutOfRangeException
     */
    private static function normalizeNumber($number, $min, $name)
    {
        if (!is_numeric($number)) {
            throw new \InvalidArgumentException("Parameter \"$name\" must be a valid number.");
        }

        if ($number < $min) {
            throw new \OutOfRangeException("Parameter \"$name\" must be $min or more.");
        }

        return (int) $number;
    }
}<commit_msg>Fix PHPDoc<commit_after><?php

namespace Phive\Queue;

class QueueUtils
{
    private function __construct()
    {
    }

    /**
     * @param \DateTime|string|int|null $eta
     *
     * @return int The Unix timestamp.
     *
     * @throws \InvalidArgumentException
     */
    public static function normalizeEta($eta)
    {
        if (null === $eta) {
            return time();
        }
        if (is_string($eta)) {
            $eta = date_create($eta);
        }
        if ($eta instanceof \DateTime) {
            return $eta->getTimestamp();
        }
        if (is_int($eta)) {
            return $eta;
        }

        throw new \InvalidArgumentException('Parameter "eta" must be a string, integer or \DateTime instance.');
    }

    /**
     * @param mixed $value
     *
     * @return int
     */
    public static function normalizeLimit($value)
    {
        return self::normalizeNumber($value, 1, 'limit');
    }

    /**
     * @param mixed $value
     *
     * @return int
     */
    public static function normalizeOffset($value)
    {
        return self::normalizeNumber($value, 0, 'offset');
    }

    /**
     * @param mixed  $number
     * @param int    $min
     * @param string $name
     * 
     * @return int
     *
     * @throws \InvalidArgumentException|\OutOfRangeException
     */
    private static function normalizeNumber($number, $min, $name)
    {
        if (!is_numeric($number)) {
            throw new \InvalidArgumentException("Parameter \"$name\" must be a valid number.");
        }

        if ($number < $min) {
            throw new \OutOfRangeException("Parameter \"$name\" must be $min or more.");
        }

        return (int) $number;
    }
}
{'fraction_non_alphanumeric': 0.13001179245283018, 'fraction_numerical': 0.0011792452830188679, 'mean_word_length': 1.8440905280804694, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '6487568', 'n_tokens_mistral': 984, 'n_tokens_neox': 949, 'n_words': 247}