Git Product home page Git Product logo

codeigniter-for-php_codesniffer's Introduction

CodeIgniter-for-PHP_CodeSniffer

Provides sniffs for PHP_CodeSniffer 1.3.0 and above to check CodeIgniter coding standard.

A bit of story

PHP_CodeSniffer

PHP_CodeSniffer is a PHP5 script that tokenises and "sniffs" PHP, JavaScript and CSS files to detect violations of a defined coding standard.

It is an essential development tool that ensures your code remains clean and consistent. It can also help prevent some common semantic errors made by developers.

By default sniffs for a few coding convetions are provided like PEAR, Zend, PHPCS and Squiz. CodeIgniter-for-PHP_CodeSniffer is aimed at adding support for CodeIgniter coding convention.

CodeIgniter coding standard

CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications.

CodeIgniter is developed by EllisLab. The compagny follows some specific coding rules for their developments and for CodeIgniter especially.

Based on PHP_CodeSniffer CodeIgniter-for-PHP_CodeSniffer helps to validate most of the rules in CodeIgniter coding standard.

Installation

There is an Apache Ant script at the root of the repository. It targets standard Linux environment like Ubuntu with PHP_CodeSniffer 1.3.0 or above installed via PEAR. It requires PHP (in its 5th version).

Just go to the root of the project and type ant to set up CodeIgniter-for-PHP_CodeSniffer. If you have CodeSniffer installed in another directory than "/usr/share/php/PHP/CodeSniffer/" than you can pass the right directory as argument to ant. Just type ant -Dphpcs.dir="/path/to/CodeSniffer/".

Check that it is installed type phpcs -i you should see a list of installed standards.

Then you can go to you project folder and run phpcs --standard=CodeIgniter my-file-or-my-directory.php.

If you work on a Windows platform or for any reason, it is easy to edit the installation script. You just need to change the property phpcs.dir in build.xml to point toward the directory containing PHP_CodeSniffer.

codeigniter-for-php_codesniffer's People

Contributors

jacksonj04 avatar lh84 avatar mukthar avatar p4ul avatar thomas-ernest avatar

Watchers

 avatar  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.