A coding standard for the style checker PHP_CodeSniffer which checks PHP source code against PSR-1 and PSR-2.
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
nbproject
src
.gitignore
COPYING
COPYING.LESSER
README.md
build.local.xml
build.properties
build.xml
package.xml

README.md

FloW Coding Standard

FloW Coding Standard is a coding standard for the style checker PHP_CodeSniffer which checks PHP source code against the PSR-1 Coding Style Guide.

This coding standard is meant to be used with the PHP scripting language. It includes a lot of sniffs that ship with PHP_CodeSniffer, but also defines some own sniffs.

In contrast to klaussukveira/phpcs-psr1 this coding standard defines more sniffs and is available as a PEAR package. Therefore this standard provides a solid base to write clean code.

Features

Requirements

System-Wide Installation

FloW Coding Standard should be installed using the PEAR Installer. This installer is the PHP community's de-facto standard for installing PHP components.

sudo pear channel-discover http://florianwolters.github.com/pear
sudo pear install --alldeps fw/phpcs_FloW

Usage

The best documentation for FloW Coding Standard are the unit tests, which are shipped in the package. You will find them installed into your PEAR repository, which on Linux systems is normally /usr/share/php/test.

Click here for the API documentation of FloW Coding Standard.

Best Practices

It is recommended to set the following PHP_CodeSniffer configuration options after the installation for convience.

phpcs --config-set default_standard FloW
phpcs --config-set encoding UTF-8
phpcs --config-set severity 1
phpcs --config-set tab_width 0

Development Environment

If you want to patch or enhance this component, you will need to create a suitable development environment. The easiest way to do that is to install phix4componentdev:

# phix4componentdev
sudo apt-get install php5-xdebug
sudo apt-get install php5-imagick
sudo pear channel-discover pear.phix-project.org
sudo pear -D auto_discover=1 install -Ba phix/phix4componentdev

You can then clone the git repository:

# phpcs-FloW
git clone https://github.com/florianwolters/phpcs-FloW

Then, install a local copy of this component's dependencies to complete the development environment:

# build vendor/ folder
phing build-vendor

To make life easier for you, common tasks (such as running unit tests, generating code review analytics, and creating the PEAR package) have been automated using Phing. You'll find the automated steps inside the build.xml file that ships with the component.

Run the command 'phing' in the component's top-level folder to see the full list of available automated tasks.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://gnu.org/licenses/lgpl.txt.