GithubHelp home page GithubHelp logo

yii2-coding-standards's Introduction

Yii 2 Web Framework Coding Standard

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

Getting code

$ php composer.phar install biaoqianwo/yii2-coding-standards

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.

PhpStorm

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

More

中文Yii规范

yii2-coding-standards's People

Contributors

alexgx avatar biaoqianwo avatar cebe avatar edgardmessias avatar frenck avatar gsherwood avatar krukru avatar nkovacs avatar qiangxue avatar resurtm avatar samdark avatar schmunk42 avatar tanakahisateru avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.