PHP Code Sniffer rules that cover a large part of the [Fuel PHP coding standards] (https://docs.fuelphp.com/general/coding_standards.html "Fuel PHP Coding Standards").
Technically this install can by bypassed by just telling PHP Code Sniffer where your standard is, this is mostly for convenience.
- clone the project
git clone [email protected]:ucfcdl/fuelphp-phpcs.git
- change directory to ./fuelphp-phpcs
cd fuelphp-phpcs
- run installer with root privileges
sudo ./install.sh
I installed a newer version of PHP on OSX, which left php and pear a little different then standard setups. If you have a similar situation you may need to go the long way around to simplify your phpcs calls
- clone the project
git clone [email protected]:ucfcdl/fuelphp-phpcs.git
- locate PEAR directory using
pear config-show
- verify PEAR directory above is included by php listed in the include_dir
php -i
- create sym link to rules in this repo
sudo ln -s DIRECTORY_TO_THIS_GIT_REPO/Standards/FuelPHP PEAR_DIRECTORY/PHP/CodeSniffer/Standards/FuelPHP
- change directory to ./fuelphp-phpcs
cd fuelphp-phpcs
- run installer with root privileges
sudo ./uninstall.sh
- remove sym link ``sudo rm PEAR_DIRECTORY/PHP/CodeSniffer/Standards/FuelPHP
run phpcs --standard=FuelPHP PROJECT_TO_SNIFF_DIRECTORY
where
PROJECT_TO_SNIFF_DIRECTORY is your fuel php project directory.
run phpcs --standard=DIRECTORY_TO_THIS_REPO/Standards/FuelPHP PROJECT_TO_SNIFF_DIRECTORY
BE AWARE not to use --tab-width phpcs option with another value than 0, this would disable tabs recognition !