4

I read this and this. But how to setup this in NetBeans IDE in Windows machine?

Abdur Rahman
  • 353
  • 5
  • 16
Jomon Johnson
  • 154
  • 2
  • 7

2 Answers2

3

Yii2 requires PHP 5.4 minimum, so if your IDE supports PHP 5.4 or later then it will show standards for Yii2 too.

You can also check this yii pligin for netbeans http://plugins.netbeans.org/plugin/47246/php-yii-framework-netbeans-phpcc

ankitr
  • 5,992
  • 7
  • 47
  • 66
  • i mean how to add yii2 coding standards in the form of codesniffer to NetBeans – Jomon Johnson Mar 15 '15 at 12:49
  • The plugin listed above is for Yii 1. Here is the URL for Yii 2 https://github.com/nbphpcouncil/nb-yii2-plugin – Craig London Mar 10 '17 at 14:47
  • Looks like you would need to install PHP_CodeSniffer, then configure it based on the instructions on the link you have above. https://github.com/yiisoft/yii2-coding-standards#php_codesniffer `$ ./vendor/bin/phpcs --extensions=php --standard=Yii2 /home/resurtm/work/Yii2MegaApp/` – Craig London Mar 10 '17 at 15:06
  • This might be useful as well. You can get some of the standards setup using editorconfig https://github.com/boo1ean/generator-yii/blob/master/.editorconfig https://github.com/yiisoft/yii2/blob/master/docs/internals/core-code-style.md – Craig London Mar 10 '17 at 15:54
0

in root of your project make file with name of autocompletion.php and add this to file.

 /**
 * 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
{
}
Mohsen
  • 1,295
  • 1
  • 15
  • 45