<commit_before><?php

$sId        = !empty($sId) ? 'id="' . $sId . '"' : null;
$sFieldName = !empty($sFieldName) ? $sFieldName : 'fields';

if (!empty($_POST[$sFieldName])) {

    $aFields = $_POST[$sFieldName];

    //  Cast as objects to match database output
    foreach ($aFields as &$aField) {

        if (!empty($aField['options'])) {

            $aField['options'] = (object) [
                'count' => count($aField['options']),
                'data'  => $aField['options'],
            ];

        } else {

            $aField['options'] = (object) [
                'count' => 0,
                'data'  => [],
            ];
        }

        foreach ($aField['options']->data as &$aOption) {
            $aOption = (object) $aOption;
        }
        unset($aOption);

        $aField = (object) $aField;
    }
    unset($aField);
}

?>
<div class="form-builder" <?=$sId?>>
    <div class="table-responsive">
        <table class="form-builder__fields">
            <thead>
                <tr>
                    <th class="order">
                    </th>
                    <th class="type">
                        Type
                    </th>
                    <th class="field-label">
                        Label &amp; Sub-label
                    </th>
                    <th class="placeholder">
                        Placeholder
                    </th>
                    <th class="required">
                        Required
                    </th>
                    <th class="default">
                        Default Value
                    </th>
                    <th class="attributes">
                        Custom Attributes
                    </th>
                    <th class="remove">
                        &nbsp;
                    </th>
                </tr>
            </thead>
            <?php

            $i = 0;

            foreach ($aFields as $oField) {

                ?>
                <tbody>
                    <tr>
                        <td class="order handle" rowspan="2">
                            <b class="fa fa-bars"></b>
                            <?php

                            echo form_hidden(
                                $sFieldName . '[' . $i . '][id]',
                                !empty($oField->id) ? $oField->id : ''
                            );

                            ?>
                        </td>
                        <td class="type">
                            <?php
<commit_msg>Adds class to form-builder fields table<commit_after><?php

$sId        = !empty($sId) ? 'id="' . $sId . '"' : null;
$sFieldName = !empty($sFieldName) ? $sFieldName : 'fields';

if (!empty($_POST[$sFieldName])) {

    $aFields = $_POST[$sFieldName];

    //  Cast as objects to match database output
    foreach ($aFields as &$aField) {

        if (!empty($aField['options'])) {

            $aField['options'] = (object) [
                'count' => count($aField['options']),
                'data'  => $aField['options'],
            ];

        } else {

            $aField['options'] = (object) [
                'count' => 0,
                'data'  => [],
            ];
        }

        foreach ($aField['options']->data as &$aOption) {
            $aOption = (object) $aOption;
        }
        unset($aOption);

        $aField = (object) $aField;
    }
    unset($aField);
}

?>
<div class="form-builder" <?=$sId?>>
    <div class="table-responsive">
        <table class="form-builder__fields">
            <thead>
                <tr>
                    <th class="order">
                    </th>
                    <th class="type">
                        Type
                    </th>
                    <th class="field-label">
                        Label &amp; Sub-label
                    </th>
                    <th class="placeholder">
                        Placeholder
                    </th>
                    <th class="required">
                        Required
                    </th>
                    <th class="default">
                        Default Value
                    </th>
                    <th class="attributes">
                        Custom Attributes
                    </th>
                    <th class="remove">
                        &nbsp;
                    </th>
                </tr>
            </thead>
            <?php

            $i = 0;

            foreach ($aFields as $oField) {

                ?>
                <tbody class="form-builder__field">
                    <tr>
                        <td class="order handle" rowspan="2">
                            <b class="fa fa-bars"></b>
                            <?php

                            echo form_hidden(
                                $sFieldName . '[' . $i . '][id]',
                                !empty($oField->id) ? $oField->id : ''
                            );

                            ?>
                        </td>
                        <td class="type">
                            <?php

{'fraction_non_alphanumeric': 0.1377891023128185, 'fraction_numerical': 0.0011760094080752645, 'mean_word_length': 0.8509249183895539, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 85, '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': '4919004', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1237, 'n_words': 256}