PHP_CodeSniffer (Previous) (Next) Usage

View this page in Last updated: Sun, 28 Sep 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Spanish | Plain HTML

Introduction

Introduction -- Description and simple usage example

Description

PHP_CodeSniffer is a PHP5 script that tokenises and "sniffs" PHP and JavaScript code 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.

A coding standard, in PHP_CodeSniffer, is a collection of sniff files. Each sniff file checks one part of the coding standard only. Multiple coding standards can be used within PHP_CodeSniffer, so that the one installation can be used across multiple projects. The default coding standard used by PHP_CodeSniffer is the PEAR coding standard.

Example

To check a file against the PEAR coding standard, simply specify the file's location.

Or, if you wish to check an entire directory, you can specify the directory location instead of a file.

PHP_CodeSniffer (Previous) (Next) Usage

Download Documentation Last updated: Sun, 28 Sep 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.