Issues (1313)

views/menu/languageItem.php (2 issues)

1
<?php
2
use yii\helpers\{Html, Url};
3
use app\helpers\BaseHelper;
4
use Itstructure\AdminModule\models\Language;
5
/* @var Language $data */
6
7
echo Html::a($data->getName(),
8
    Url::to(BaseHelper::getSwitchLanguageLink($data->getShortName(), Yii::$app->request)), [
0 ignored issues
show
It seems like Yii::app->request can also be of type yii\console\Request; however, parameter $request of app\helpers\BaseHelper::getSwitchLanguageLink() does only seem to accept yii\web\Request, 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

8
    Url::to(BaseHelper::getSwitchLanguageLink($data->getShortName(), /** @scrutinizer ignore-type */ Yii::$app->request)), [
Loading history...
9
        'target' => '_self'
10
    ]
11
);
12
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
13