Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (20 sloc) 1.724 kB
f658a88 @LouisLandry Initial commit.
LouisLandry authored
1 Joomla Coding Standards
2 =======================
3
4 This repository includes the [Joomla](http://developer.joomla.org) coding standard definition for [PHP Codesniffer](http://pear.php.net/PHP_CodeSniffer) along with a few other helpful resources. The PHP_CodeSniffer standard will never be 100% accurate, but should be viewed as a strong set of guidelines while writing software for Joomla.
5
b91e08d @javigomez Adding link to coding standards site
javigomez authored
6 See Joomla coding standards documentation at [http://joomla.github.io/coding-standards/](http://joomla.github.io/coding-standards/)
7
4281a0e @javigomez Adding link to source files of the documentation
javigomez authored
8 If you want to contribute and improve this documentation find the source files at [https://github.com/joomla/coding-standards/tree/gh-pages](https://github.com/joomla/coding-standards/tree/gh-pages)
9
f658a88 @LouisLandry Initial commit.
LouisLandry authored
10 ## Requirements
11
12 * PHP 5.3+
13 * [PHP Codesniffer](http://pear.php.net/PHP_CodeSniffer) 1.3+
14
9aa4af3 @javigomez Add alert about PHPCS 2.0 not compatible with our sniffers
javigomez authored
15 **Important note**: currently the latest PHPCS is the 2.x series. But they are under development so Joomla Sniffers are not yet compatible with this version. PEAR gives you the option to install it by default but Joomla sniffers will not work, thus remind to always install PHPCS in a version below 2.0.
16
f658a88 @LouisLandry Initial commit.
LouisLandry authored
17
18 ## Installation
19
20 Installation is as easy as checking out the repository to the correct location within PHP_CodeSniffer's directory structure.
21
22 ### Install PHP_CodeSniffer.
23
9aa4af3 @javigomez Add alert about PHPCS 2.0 not compatible with our sniffers
javigomez authored
24 pear install PHP_CodeSniffer-1.5.3
f658a88 @LouisLandry Initial commit.
LouisLandry authored
25
26 ### Install the Joomla standard.
27
f9fc79a @n-rodriguez Update README.md
n-rodriguez authored
28 git clone https://github.com/joomla/coding-standards.git `pear config-get php_dir`/PHP/CodeSniffer/Standards/Joomla
f658a88 @LouisLandry Initial commit.
LouisLandry authored
29
30 ## Running
31
32 You can use the installed Joomla standard like:
33
34 phpcs --standard=Joomla path/to/code
35
36 Alternatively if it isn't installed you can still reference it by path like:
37
38 phpcs --standard=path/to/joomla/coding-standards path/to/code
Something went wrong with that request. Please try again.