Issues (150)

sample/views/user/select-account.php (1 issue)

Labels
Severity
1
<?php
2
3
/* @var $this yii\web\View */
4
/* @var $form yii\bootstrap4\ActiveForm */
5
/* @var $model sample\models\AccountSelectionForm */
6
7
use yii\bootstrap4\ActiveForm;
8
use yii\bootstrap4\Html;
9
10
$this->title = 'Select Account';
11
$this->params['breadcrumbs'][] = $this->title;
12
13
$availableIdentities = [];
14
foreach ($model->user->getAvailableIdentities() as $availableIdentity) {
0 ignored issues
show
The method getAvailableIdentities() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
foreach ($model->user->/** @scrutinizer ignore-call */ getAvailableIdentities() as $availableIdentity) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
    $availableIdentities[$availableIdentity->id] = $availableIdentity->username;
16
}
17
18
?>
19
<div class="site-select-account">
20
    <h1><?= Html::encode($this->title) ?></h1>
21
22
    <p>Please select an Account:</p>
23
24
    <?php $form = ActiveForm::begin([
25
        'id' => 'account-selection-form',
26
        'layout' => 'horizontal',
27
        'fieldConfig' => [
28
            'template' => "{label}\n<div class=\"col-lg-3\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
29
            'labelOptions' => ['class' => 'col-lg-1 col-form-label'],
30
        ],
31
    ]); ?>
32
33
    <?= $form->field($model, 'identityId')->radioList($availableIdentities)->label(false) ?>
34
35
    <div class="form-group">
36
        <div class="offset-lg-1 col-lg-11">
37
            <?= Html::submitButton('Select', ['class' => 'btn btn-primary', 'name' => 'select-account-button']) ?>
38
        </div>
39
    </div>
40
41
    <?php ActiveForm::end(); ?>
42
</div>
43