<commit_before><?php
/*
 * This file is part of the Grace package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Grace\ORM\Type;

class TypeShortTariff implements TypeInterface
{
    public function getAlias()
    {
        return 'short_tariff';
    }
    public function getPhpType()
    {
        return '\Grace\ORM\Type\ShortTariffValue';
    }
    public function getDbType()
    {
        return 'varchar(255)';
    }
    public function convertDbToPhp($value)
    {
        return new ShortTariffValue($value);
    }
    public function convertOnSetter($value)
    {
        if ($value instanceof ShortTariffValue) {
            return $value;
        }

        if (!is_scalar($value)) {
            throw new ConversionImpossibleException('Value of type ' . gettype($value) . ' can not be presented as tarif string');
        }

        return new ShortTariffValue($value);
    }
    public function convertPhpToDb($value)
    {
        return $value;
    }
}
<commit_msg>Fixed a tariff typo<commit_after><?php
/*
 * This file is part of the Grace package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Grace\ORM\Type;

class TypeShortTariff implements TypeInterface
{
    public function getAlias()
    {
        return 'short_tariff';
    }
    public function getPhpType()
    {
        return '\Grace\ORM\Type\ShortTariffValue';
    }
    public function getDbType()
    {
        return 'varchar(255)';
    }
    public function convertDbToPhp($value)
    {
        return new ShortTariffValue($value);
    }
    public function convertOnSetter($value)
    {
        if ($value instanceof ShortTariffValue) {
            return $value;
        }

        if (!is_scalar($value)) {
            throw new ConversionImpossibleException('Value of type ' . gettype($value) . ' can not be presented as tariff string');
        }

        return new ShortTariffValue($value);
    }
    public function convertPhpToDb($value)
    {
        return $value;
    }
}

{'fraction_non_alphanumeric': 0.09905447996398019, 'fraction_numerical': 0.0027014858171994596, 'mean_word_length': 2.4610591900311527, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '2351571', 'n_tokens_mistral': 650, 'n_tokens_neox': 641, 'n_words': 183}