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

Php 在NetBeans中设置Yii 2 Web框架编码标准,php,netbeans,yii,yii2,codesniffer,Php,Netbeans,Yii,Yii2,Codesniffer,我阅读和阅读。但是如何在Windows机器上的NetBeans IDE中设置它呢?Yii2至少需要PHP5.4,因此如果您的IDE支持PHP5.4或更高版本,那么它也会显示Yii2的标准 您还可以在名为autocompletion.php的project make文件的根目录中检查此yii pligin for netbeans,并将其添加到文件中 /** * Yii bootstrap file. * Used for enhanced IDE code autocompletion.

我阅读和阅读。但是如何在Windows机器上的NetBeans IDE中设置它呢?

Yii2至少需要PHP5.4,因此如果您的IDE支持PHP5.4或更高版本,那么它也会显示Yii2的标准


您还可以在名为autocompletion.php的project make文件的根目录中检查此yii pligin for netbeans

,并将其添加到文件中

 /**
 * 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
{
}

我的意思是如何将Yi2编码标准以codesniffer的形式添加到NetBeans上面列出的插件是针对Yi1的。这是Yii 2的URL,看起来您需要安装PHP_CodeSniffer,然后根据上面链接上的说明进行配置<代码>$./vendor/bin/phpcs--extensions=php--standard=Yii2/home/resurtm/work/Yii2MegaApp/这可能也很有用。您可以使用editorconfig获得一些标准设置