Yii2 Yii的Yii phpdoc::$app->;护照

Yii2 Yii的Yii phpdoc::$app->;护照,yii2,phpdoc,Yii2,Phpdoc,我的IDE PHPStorm将下一行标记为错误(单词“password”) 我如何为它编写phpdoc 可能在这样的地方,或者怎样 /** @var $Yii::$app->passport array */ Yii::$app->passport->getLoginUrl($Url); 您可以在中找到解决方案 使用自定义Yii类 给IDE一些提示的最好方法是使用您自己的Yii文件 在运行代码时实际上没有使用。此文件可能被命名为 Yii.php,内容可以是: 欢迎链接到潜在的

我的IDE PHPStorm将下一行标记为错误(单词“password”)

我如何为它编写phpdoc

可能在这样的地方,或者怎样

/** @var $Yii::$app->passport array */
Yii::$app->passport->getLoginUrl($Url);

您可以在中找到解决方案

使用自定义Yii类

给IDE一些提示的最好方法是使用您自己的Yii文件 在运行代码时实际上没有使用。此文件可能被命名为
Yii.php
,内容可以是:


欢迎链接到潜在的解决方案,但请确保您的其他用户知道它是什么以及为什么会出现。始终引用重要链接中最相关的部分,以防无法访问目标站点或永久脱机。考虑到仅仅是一个指向外部站点的链接是一个可能的原因。写“word”password是指
passport
?因为
密码
这个词在这里的任何地方都不会出现:-)
/** @var $Yii::$app->passport array */
Yii::$app->passport->getLoginUrl($Url);
<?php
/**
 * Yii bootstrap file.
 * Used for enhanced IDE code autocompletion.
 */
class Yii extends \yii\BaseYii
{
    /**
     * @var BaseApplication|WebApplication|ConsoleApplication the application instance
     */
    public static $app;
}

/**
 * Class BaseApplication
 * Used for properties that are identical for both WebApplication and ConsoleApplication
 *
 * @property \app\components\RbacManager $authManager The auth manager for this application. Null is returned if auth manager is not configured. This property is read-only. Extended component.
 * @property \app\components\Mailer $mailer The mailer component. This property is read-only. Extended component.
 */
abstract class BaseApplication extends yii\base\Application
{
}

/**
 * Class WebApplication
 * Include only Web application related components here
 *
 * @property \app\components\User $user The user component. This property is read-only. Extended component.
 * @property \app\components\MyResponse $response The response component. This property is read-only. Extended component.
 * @property \app\components\ErrorHandler $errorHandler The error handler application component. This property is read-only. Extended component.
 */
class WebApplication extends yii\web\Application
{
}

/**
 * Class ConsoleApplication
 * Include only Console application related components here
 *
 * @property \app\components\ConsoleUser $user The user component. This property is read-only. Extended component.
 */
class ConsoleApplication extends yii\console\Application
{
}