在NetBeans中设置Yii 2 Web框架编码标准

jdgnovmf  于 2022-11-09  发布在  其他
关注(0)|答案(2)|浏览(110)

我读了thisthis。但是如何在Windows机器的NetBeans IDE中设置这个呢?

b09cbbtk

b09cbbtk1#

Yii2至少需要PHP 5.4,因此如果您的IDE支持PHP 5.4或更高版本,则也会显示Yii2的标准。

您也可以检查这个yii pligin for netbeans http://plugins.netbeans.org/plugin/47246/php-yii-framework-netbeans-phpcc

6kkfgxo0

6kkfgxo02#

在项目根目录下,创建一个名为autocompletion.php的文件,并将其添加到文件中。

/**
 * Yii bootstrap file.
 * Used for enhanced IDE code autocompletion.
 * Note: To avoid "Multiple Implementations" PHPStorm warning and make autocomplete faster
 * exclude or "Mark as Plain Text" vendor/yiisoft/yii2/Yii.php file
 */
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 trntv\filekit\Storage $fileStorage
 * @property common\components\keyStorage\KeyStorage $keyStorage
 * @property yii\web\UrlManager $urlManagerFrontend UrlManager for frontend application.
 * @property yii\web\UrlManager $urlManagerBackend UrlManager for backend application.
 * @property yii\web\UrlManager $urlManagerStorage UrlManager for storage application.
 * @property trntv\glide\components\Glide $glide
 * @property trntv\bus\CommandBus $commandBus
 */
abstract class BaseApplication extends yii\base\Application
{
}

/**
 * Class WebApplication
 * Include only Web application related components here
 *
 * @property User $user User component.
 */
class WebApplication extends yii\web\Application
{
}

/**
 * Class ConsoleApplication
 * Include only Console application related components here
 */
class ConsoleApplication extends yii\console\Application
{
}

/**
 * User component
 * Include only Web application related components here
 *
 * @property \common\models\User $identity User model.
 * @method \common\models\User getIdentity() returns User model.
 */
class User extends \yii\web\User
{
}

相关问题