<commit_before><?php

namespace Norm\Schema;

class Boolean extends Field
{
    public function prepare($value)
    {
        return (boolean) $value;
    }

    public function presetInput($value, $entry = null)
    {
        return '
            <select name="'.$this['name'].'">
                <option value="0" '.(!$value ? 'selected' : '').'>False</option>
                <option value="1" '.($value ? 'selected' : '').'>True</option>
            </select>
        ';
    }

    public function presetReadonly($value, $entry = null)
    {
        return $value ? 'True' : 'False';
    }
}<commit_msg>fixed preset for boolean schema<commit_after><?php

namespace Norm\Schema;

class Boolean extends Field
{
    public function prepare($value)
    {
        return (boolean) $value;
    }

    public function presetInput($value, $entry = null)
    {
        return '
            <select name="'.$this['name'].'">
                <option value="0" '.(!$value ? 'selected' : '').'>False</option>
                <option value="1" '.($value ? 'selected' : '').'>True</option>
            </select>
        ';
    }

    public function presetPlain($value, $entry = null)
    {
        return $value ? 'True' : 'False';
    }

    public function presetReadonly($value, $entry = null)
    {
        return '<span class="field">'.$this->presetPlain($value, $entry).'</span>';
    }
}
{'fraction_non_alphanumeric': 0.17413294797687862, 'fraction_numerical': 0.002890173410404624, 'mean_word_length': 2.1912442396313363, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 18, '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': '3487706', 'n_tokens_mistral': 419, 'n_tokens_neox': 411, 'n_words': 95}