<commit_before><?php

namespace Grafite\Forms\Services;

use Illuminate\Support\Str;
use Grafite\Forms\Builders\FieldBuilder;

class FieldMaker
{
    protected $builder;

    public $orientation;

    protected $standard = [
        'hidden',
        'text',
        'number',
        'color',
        'email',
        'date',
        'datetime-local',
        'month',
        'range',
        'search',
        'tel',
        'time',
        'url',
        'week',
        'password',
        'time',
        'image',
        'file',
    ];

    protected $special = [
        'select',
        'custom-file',
        'textarea',
        'relationship',
    ];

    protected $specialSelect = [
        'checkbox',
        'radio',
        'checkbox-inline',
        'radio-inline',
    ];

    public function __construct(FieldBuilder $fieldBuilder)
    {
        $this->builder = $fieldBuilder;
    }

    public function make(string $column, array $columnConfig, $object = null)
    {
        if ($columnConfig['type'] === 'html') {
            return $columnConfig['content'];
        }

        $field = null;
        $fieldGroup = config('forms.form.group-class', 'form-group');

        if ($this->orientation === 'horizontal') {
            $fieldGroup = $fieldGroup . ' ' . config('forms.form.sections.row-class', 'row');
        }

        $value = $this->getOldValue($column);

        if (!is_null($object)) {
            $value = $this->getObjectValue($object, $column);
        }<commit_msg>Because old values should bypass object empty ones<commit_after><?php

namespace Grafite\Forms\Services;

use Illuminate\Support\Str;
use Grafite\Forms\Builders\FieldBuilder;

class FieldMaker
{
    protected $builder;

    public $orientation;

    protected $standard = [
        'hidden',
        'text',
        'number',
        'color',
        'email',
        'date',
        'datetime-local',
        'month',
        'range',
        'search',
        'tel',
        'time',
        'url',
        'week',
        'password',
        'time',
        'image',
        'file',
    ];

    protected $special = [
        'select',
        'custom-file',
        'textarea',
        'relationship',
    ];

    protected $specialSelect = [
        'checkbox',
        'radio',
        'checkbox-inline',
        'radio-inline',
    ];

    public function __construct(FieldBuilder $fieldBuilder)
    {
        $this->builder = $fieldBuilder;
    }

    public function make(string $column, array $columnConfig, $object = null)
    {
        if ($columnConfig['type'] === 'html') {
            return $columnConfig['content'];
        }

        $field = null;
        $fieldGroup = config('forms.form.group-class', 'form-group');

        if ($this->orientation === 'horizontal') {
            $fieldGroup = $fieldGroup . ' ' . config('forms.form.sections.row-class', 'row');
        }

        $value = $this->getOldValue($column);

        if (! is_null($object)) {
            $objectValue = $this->getObjectValue($object, $column);

            if (! empty($objectValue)) {
                $value = $objectValue;
            }
        }
{'fraction_non_alphanumeric': 0.15160164922296226, 'fraction_numerical': 0.0, 'mean_word_length': 1.8312387791741471, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2616429', 'n_tokens_mistral': 914, 'n_tokens_neox': 899, 'n_words': 177}