Skip to content

Wolg/cakephp-codesniffs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP CodeSniffer for CakePHP

This repository contains the CakePHP standard for use with the pear package PHP CodeSniffer

Installation

Obviously, you need PHP CodeSniffer for this repository to have any meaning.

Locate the CodeSniffer/Standards folder in your CodeSniffer install, and install this repository with the name "Cake" e.g.:

cd /usr/share/pear/PHP/CodeSniffer/Standards/
git clone git://github.com/Wolg/cakephp-codesniffs.git Cake

If you work mainly with CakePHP, or your work simply follows the same coding standards, you may wish to configure PHP Code Sniffer to use this standard by default:

phpcs --config-set default_standard Cake

Use as a git pre-commit hook

To run phpcs checks each time you commit a file, you can use the pre-commit hook provided in this repo. For example

cd /var/www/apps/myapp/.git/hooks/
cp /usr/share/pear/PHP/CodeSniffer/Standards/Cake/pre-commit .
chmod +x pre-commit

References and Credits

About

CakePHP standard for PHP CodeSniffer

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%