Issues (27)

backend/views/layouts/header.php (1 issue)

Labels
Severity
1
<?php
2
use yii\helpers\Url;
3
use backend\widgets\Button;
4
5
/**
6
 * @var \yii\web\View $this
7
 * @var \common\models\User $user
8
 * @var string $directoryAsset
9
 * @var string $content
10
 */
11
$user = Yii::$app->user->identity;
12
13
?>
14
15
<header class="main-header">
16
17
    <a class="logo" href="<?=Url::to(Yii::$app->homeUrl)?>">
0 ignored issues
show
It seems like Yii::app->homeUrl can also be of type object; however, parameter $url of yii\helpers\BaseUrl::to() does only seem to accept string|array, maybe add an additional type check? ( Ignorable by Annotation )

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

17
    <a class="logo" href="<?=Url::to(/** @scrutinizer ignore-type */ Yii::$app->homeUrl)?>">
Loading history...
18
        <span class="logo-mini"><i class="fa fa-envelope-open-o"></i></span>
19
        <span class="logo-lg"><i class="fa fa-envelope-open-o"></i> <?=Yii::$app->name?></span>
20
    </a>
21
22
    <nav class="navbar navbar-static-top" role="navigation">
23
24
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
25
            <span class="sr-only">Toggle navigation</span>
26
        </a>
27
28
        <div class="navbar-custom-menu">
29
            <ul class="nav navbar-nav">
30
                <li class="dropdown user user-menu">
31
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
32
                        <i class="fa fa-user-md"></i>
33
                        <span class="hidden-xs"><?= $user->username ?></span>
34
                    </a>
35
                    <ul class="dropdown-menu">
36
                        <!-- User image -->
37
                        <li class="user-header">
38
                            <p>
39
                                <i class="fa fa-user-circle" aria-hidden="true"></i>
40
                                <small>Member since <?= date('M. Y', $user->created_at) ?></small>
41
                            </p>
42
                        </li>
43
                        <!-- Menu Footer-->
44
                        <li class="user-footer">
45
                            <div class="pull-left">
46
                                <?= Button::widget([
47
                                    'label' => 'Profile',
48
                                    'link' => ['/users/view', 'id' => $user->id],
49
                                ]) ?>
50
                            </div>
51
                            <div class="pull-right">
52
                                <?= Button::widget([
53
                                    'label' => 'Sign out',
54
                                    'link' => ['/site/logout'],
55
                                    'options' => ['data-method' => 'post'],
56
                                ]) ?>
57
                            </div>
58
                        </li>
59
                    </ul>
60
                </li>
61
            </ul>
62
        </div>
63
    </nav>
64
</header>
65