Completed
Push — master ( 4e2c55...2c21d8 )
by Andrey
01:28
created

src/views/fieldsMultilanguage.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use yii\base\Model;
4
use yii\helpers\ArrayHelper;
5
use yii\widgets\ActiveForm;
6
use Itstructure\FieldWidgets\helpers\Helper;
7
use Itstructure\FieldWidgets\FieldType;
8
use Itstructure\FieldWidgets\interfaces\{LanguageListInterface, LanguageFieldInterface};
9
10
/** @var LanguageListInterface $languageModel */
11
/** @var LanguageFieldInterface $language */
12
/** @var array[] $fields */
13
/** @var Model $model */
14
/** @var ActiveForm $form */
15
?>
16
17
<ul class="nav nav-tabs" id="languages">
18 View Code Duplication
    <?php foreach ($languageModel->getLanguageList() as $language): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
        <li class="<?php echo Helper::isActiveTab($language) ?>">
20
            <a href="#<?php echo $language->getShortName() ?>" data-toggle="tab"><?php echo $language->getName() ?></a>
21
        </li>
22
    <?php endforeach; ?>
23
</ul>
24
25
<div class="tab-content">
26
    <?php foreach ($languageModel->getLanguageList() as $language): ?>
27
        <div class="tab-pane <?php echo Helper::isActiveTab($language) ?>" id="<?php echo $language->getShortName() ?>">
28
29 View Code Duplication
            <?php foreach ($fields as $field): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
31
                <?php if (empty($field)) {
32
                    continue;
33
                } ?>
34
35
                <?php echo FieldType::widget(ArrayHelper::merge($field, [
36
                    'model' => $model,
37
                    'form' => $form,
38
                    'language' => $language,
39
                ])) ?>
40
41
            <?php endforeach; ?>
42
43
        </div>
44
    <?php endforeach; ?>
45
</div>
46