All Projects → yiisoft → Yii2 Coding Standards

yiisoft / Yii2 Coding Standards

Yii 2 coding standards

Labels

Projects that are alternatives of or similar to Yii2 Coding Standards

Yii2 Twig
Yii 2 Twig extension.
Stars: ✭ 130 (-23.53%)
Mutual labels:  yii2
Jnoj
Jiangnan Online Judge
Stars: ✭ 151 (-11.18%)
Mutual labels:  yii2
Yii2 Swoole
make yii2 project runing on swoole
Stars: ✭ 161 (-5.29%)
Mutual labels:  yii2
Yii2 Swagger
yii2 with swagger-php
Stars: ✭ 138 (-18.82%)
Mutual labels:  yii2
Yii2 Wx
这可能是yii2中最好用的微信SDK🔥🔥🔥
Stars: ✭ 148 (-12.94%)
Mutual labels:  yii2
Yii2 Cms
YiiCMS - 基于 Yii2 的高度可定制化开源 CMS
Stars: ✭ 153 (-10%)
Mutual labels:  yii2
Yii2 Shell
Interactive shell
Stars: ✭ 129 (-24.12%)
Mutual labels:  yii2
Rageframe
基于yii2的应用开发引擎
Stars: ✭ 170 (+0%)
Mutual labels:  yii2
Yii2 Assets Auto Compress
Automatic compilation of js + css + html
Stars: ✭ 147 (-13.53%)
Mutual labels:  yii2
Yii2 Ueditor Widget
UEditor for Yii2
Stars: ✭ 158 (-7.06%)
Mutual labels:  yii2
Yii2 Json Api
Implementation of JSON API specification for the Yii framework
Stars: ✭ 139 (-18.24%)
Mutual labels:  yii2
Awesome Yii2
Yii2 干货集
Stars: ✭ 1,800 (+958.82%)
Mutual labels:  yii2
Yii2 Comments
Comments module for Yii2
Stars: ✭ 155 (-8.82%)
Mutual labels:  yii2
Yii2 Minimal
Yii 2 minimal application template
Stars: ✭ 133 (-21.76%)
Mutual labels:  yii2
Balance
Balance accounting (bookkeeping) system based on debit and credit principle
Stars: ✭ 162 (-4.71%)
Mutual labels:  yii2
Yii2 Ace Admin
我的Yii2 Admin后台项目
Stars: ✭ 130 (-23.53%)
Mutual labels:  yii2
Yii2 Export
A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)
Stars: ✭ 153 (-10%)
Mutual labels:  yii2
Crontab
Yii2 extension for crontab support
Stars: ✭ 170 (+0%)
Mutual labels:  yii2
Stat.ink
https://stat.ink/
Stars: ✭ 163 (-4.12%)
Mutual labels:  yii2
Yii2 Workflow
A simple workflow engine for Yii2
Stars: ✭ 157 (-7.65%)
Mutual labels:  yii2

Yii 2 Web Framework Coding Standard

This repository contains settings for Yii2 coding style for various tools.

Getting code

You can get code style definition using one of the following methods.

  • Clone yiisoft/yii2-coding-standards repository:
$ git clone git://github.com/yiisoft/yii2-coding-standards.git
  • Install composer.phar distribution:
$ curl -sS https://getcomposer.org/installer | php

Or if your system doesn't have CURL installed:

$ php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
  • Set up all dependencies declared in composer.json:
$ php composer.phar install

PHP_Codesniffer

PHP_CodeSniffer coding standard, rule set and sniff token parsing classes for the Yii 2 Web Framework. Overally rules are based on PSR-2 standard with some minor exceptions and changes. Rules derived from PSR-2 standard and excluded in Yii2 standard were implemented (or planned to be) as sniff classes.

Rules could also be used for checking code style of an existing Yii2 applications.

Everything that is merged into main Yii2 development repository being checked with these rule set as well.

Using code style

After CodeSniffer is installed you can launch it with custom code style using the following syntax:

$ ./vendor/bin/phpcs --extensions=php --standard=Yii2 /home/resurtm/work/Yii2MegaApp/

If you're using PhpStorm you can configure it to use CodeSniffer using Settings → PHP → Code Sniffer. Yii2 code style can be specified at Inspections → PHP → PHP Code Sniffer validation.

Useful links

PhpStorm

Yii uses PSR-1 and PSR-2 as code style standards. You can choose these via SettingsCode StylePHPSet from...Predefined StylePSR1/PSR2.

ADDITIONAL NOTES

Feel free to request additional features, submit bugs and problems.

Thank you for choosing Yii Framework!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].