<commit_before><?php

namespace My\Doctrine\Types\Arrays;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use My\Doctrine\Types\TypesException;

class IntegerType extends Type
{
    const TYPENAME = 'array_int';

    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
    {
        if ($platform->getName() !== 'postgresql') {
            throw TypesException::platformNotSupported($this->getName(), $platform);
        }

        return 'INT[]';
    }

    public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return 'NULL';
        }

        if (!is_array($value)) {
            $value = array($value);
        }

        $arrayConstructorParameters =
            json_encode($value, JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE, 1);

        if (false === $arrayConstructorParameters) {
            throw TypesException::invalidValue($this->getName(), 'one dimensional array of integers');
        }

        return '{' . substr($arrayConstructorParameters, 1, -1) . '}';
    }

    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return null;<commit_msg>Removed depth parameter of json_encode<commit_after><?php

namespace My\Doctrine\Types\Arrays;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use My\Doctrine\Types\TypesException;

class IntegerType extends Type
{
    const TYPENAME = 'array_int';

    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
    {
        if ($platform->getName() !== 'postgresql') {
            throw TypesException::platformNotSupported($this->getName(), $platform);
        }

        return 'INT[]';
    }

    public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return 'NULL';
        }

        if (!is_array($value)) {
            $value = array($value);
        }

        $arrayConstructorParameters =
            json_encode($value, JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE);

        if (false === $arrayConstructorParameters) {
            throw TypesException::invalidValue($this->getName(), 'one dimensional array of integers');
        }

        return '{' . substr($arrayConstructorParameters, 1, -1) . '}';
    }

    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return null;
{'fraction_non_alphanumeric': 0.12108150470219435, 'fraction_numerical': 0.001959247648902821, 'mean_word_length': 2.82185628742515, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3390687', 'n_tokens_mistral': 707, 'n_tokens_neox': 680, 'n_words': 148}