<commit_before><?php
namespace Bolt\Storage\Field;

/**
 * Class to manage instances of fields and instantiate the defaults.
 *
 * @author <NAME> <<EMAIL>>
 **/

class Manager
{
    protected $fields = [];

    protected $defaults = [
        'text', 'integer', 'float', 'geolocation', 'imagelist', 'image', 'file', 'filelist', 'video', 'hidden', 'html',
        'textarea', 'datetime', 'date', 'select', 'templateselect', 'templatefields', 'markdown', 'checkbox', 'slug', 'repeater'
    ];

    public function __construct()
    {
        foreach ($this->defaults as $default) {
            $field = new Base($default, '@bolt/editcontent/fields/_' . $default . '.twig');
            $this->addField($field);
        }
    }

    public function addField(FieldInterface $field)
    {
        $this->fields[$field->getName()] = $field;
    }

    public function fields()
    {
        return $this->fields;
    }

    public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        } else {
            return false;
        }
    }

    public function has($field)
    {
        return isset($this->fields[$field]);
    }
}<commit_msg>add dummy fields to legacy field manager<commit_after><?php
namespace Bolt\Storage\Field;

/**
 * Class to manage instances of fields and instantiate the defaults.
 *
 * @author <NAME> <<EMAIL>>
 **/

class Manager
{
    protected $fields = [];

    protected $defaults = [
        'text', 'integer', 'float', 'geolocation', 'imagelist', 'image', 'file', 'filelist', 'video', 'hidden', 'html',
        'textarea', 'datetime', 'date', 'select', 'templateselect', 'templatefields', 'markdown', 'checkbox', 'slug'
    ];

    protected $dummyFields = ['repeater'];

    public function __construct()
    {
        foreach ($this->defaults as $default) {
            $field = new Base($default, '@bolt/editcontent/fields/_' . $default . '.twig');
            $this->addField($field);
        }
    }

    public function addField(FieldInterface $field)
    {
        $this->fields[$field->getName()] = $field;
    }

    public function fields()
    {
        return $this->fields;
    }

    public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        } else {
            return false;
        }
    }

    public function has($field)
    {
        return isset($this->fields[$field]) || isset($this->dummyFields[$field]);
    }
}
{'fraction_non_alphanumeric': 0.1685483870967742, 'fraction_numerical': 0.0, 'mean_word_length': 2.5042372881355934, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '6861812', 'n_tokens_mistral': 733, 'n_tokens_neox': 719, 'n_words': 175}