<commit_before><?php

namespace Ncmb;

/**
 * Encoder utility class
 */
class Encoder
{
    /**
     * Encode value
     *
     * @param mixed $value             Value to encode
     * @throws \Ncmb\Exception
     * @return mixed Encoded results.
     */
    public static function encode($value)
    {
        if ($value instanceof \DateTime ||
            $value instanceof \DateTimeImmutable) {
            return [
                '__type' => 'Date', 'iso' => self::getProperDateFormat($value),
            ];
        }

        if ($value instanceof \stdClass) {
            return $value;
        }

        if ($value instanceof Encodable) {
            return $value->encode();
        }

        if (is_array($value)) {
            return self::encodeArray($value, $allowParseObjects);
        }

        if (!is_scalar($value) && $value !== null) {
            throw new Exception('Invalid type encountered.');
        }<commit_msg>Fix to remove unused variable.<commit_after><?php

namespace Ncmb;

/**
 * Encoder utility class
 */
class Encoder
{
    /**
     * Encode value
     *
     * @param mixed $value             Value to encode
     * @throws \Ncmb\Exception
     * @return mixed Encoded results.
     */
    public static function encode($value)
    {
        if ($value instanceof \DateTime ||
            $value instanceof \DateTimeImmutable) {
            return [
                '__type' => 'Date', 'iso' => self::getProperDateFormat($value),
            ];
        }

        if ($value instanceof \stdClass) {
            return $value;
        }

        if ($value instanceof Encodable) {
            return $value->encode();
        }

        if (is_array($value)) {
            return self::encodeArray($value);
        }

        if (!is_scalar($value) && $value !== null) {
            throw new Exception('Invalid type encountered.');
        }
{'fraction_non_alphanumeric': 0.12493354598617756, 'fraction_numerical': 0.0, 'mean_word_length': 1.7001434720229556, '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': '1737450', 'n_tokens_mistral': 506, 'n_tokens_neox': 498, 'n_words': 131}