<commit_before><?php
/**
 * @var \yii\db\ActiveRecord $model
 * @var \DevGroup\DataStructure\models\Property $property
 * @var \DevGroup\DataStructure\propertyHandler\AbstractPropertyHandler | \yii\web\View $this
 */

use yii\widgets\ActiveForm;
use yii\helpers\Html;

?>
<?php if ($property->allow_multiple_values == 1): ?>
    <?php
    $inputName = Html::getInputName($model, $property->key) . '[]';
    $inputId = Html::getInputId($model, $property->key);
    $values = (array) $model->{$property->key};
    if (count($values) === 0) {
        $values = [''];
    }
    ?>
    <div class="m-form__col multi-eav">
        <label for="<?= $inputId ?>-0">
            <?= $model->getAttributeLabel($property->key) ?>
            <button class="btn btn-info btn-xs" data-action="add-new-eav-input"><i class="fa fa-plus"></i></button>
        </label>
        <?php foreach ($values as $index => $value): ?>
            <div class="input-group">
                <div class="input-group-addon arrows"><i class="fa fa-arrows"></i></div>
                <?=
                Html::input(
                    'text',
                    $inputName,
                    $value,
                    [
                        'class' => 'form-control',
                        'id' => $inputId . '-' . $index,
                        'name' => $inputName,
                    ]
                )
                ?>
                <div class="input-group-addon">
                    <button class="btn btn-xs btn-danger" data-action="delete-eav-input"><i class="fa fa-close"></i></button>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
<?php else: ?>
    <?php echo (new ActiveForm())->field($model, $property->key); ?>
<?php endif; ?><commit_msg>added a validation message for multi-eav property<commit_after><?php
/**
 * @var \yii\db\ActiveRecord $model
 * @var \DevGroup\DataStructure\models\Property $property
 * @var \DevGroup\DataStructure\propertyHandler\AbstractPropertyHandler | \yii\web\View $this
 */

use yii\widgets\ActiveForm;
use yii\helpers\Html;

?>
<?php if ($property->allow_multiple_values == 1): ?>
    <?php
    $inputName = Html::getInputName($model, $property->key) . '[]';
    $inputId = Html::getInputId($model, $property->key);
    $values = (array) $model->{$property->key};
    if (count($values) === 0) {
        $values = [''];
    }
    ?>
    <div class="m-form__col multi-eav <?= $model->hasErrors($property->key) ? 'has-error' : '' ?>">
        <label for="<?= $inputId ?>-0">
            <?= $model->getAttributeLabel($property->key) ?>
            <button class="btn btn-info btn-xs" data-action="add-new-eav-input"><i class="fa fa-plus"></i></button>
        </label>
        <?php foreach ($values as $index => $value): ?>
            <div class="input-group">
                <div class="input-group-addon arrows"><i class="fa fa-arrows"></i></div>
                <?=
                Html::input(
                    'text',
                    $inputName,
                    $value,
                    [
                        'class' => 'form-control',
                        'id' => $inputId . '-' . $index,
                        'name' => $inputName,
                    ]
                )
                ?>
                <div class="input-group-addon">
                    <button class="btn btn-xs btn-danger" data-action="delete-eav-input"><i class="fa fa-close"></i></button>
                </div>
            </div>
        <?php endforeach; ?>
        <div class="help-block"><?= implode('<br />', $model->getErrors($property->key)) ?></div>
    </div>
<?php else: ?>
    <?php echo (new ActiveForm())->field($model, $property->key); ?>
<?php endif; ?>
{'fraction_non_alphanumeric': 0.19171122994652406, 'fraction_numerical': 0.0016042780748663102, 'mean_word_length': 1.8492003046458492, 'pattern_counts': {'":': 0, '<': 70, '<?xml version=': 0, '>': 100, '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': '1786012', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1110, 'n_words': 205}