News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Zumba Engineering Blog:
Enforce code standards with composer, git hooks, and phpcs
April 15, 2014 @ 09:13:48

The Zumba Engineering blog has a new post looking at a way you can control code quality and standards with the help of Composer, git hooks and the PHP Code Sniffer (phpcs) tools.

Maintaining code quality on projects where there are many developers contributing is a tough assignment. How many times have you tried to contribute to an open-source project only to find the maintainer rejecting your pull request on the grounds of some invisible coding standard? [...] Luckily there are tools that can assist maintainers. In this post, I'll be going over how to use composer, git hooks, and phpcs to enforce code quality rules.

These three technologies are combined together to make a more seamless experience for the developer while keeping the code quality high. Their method makes use of the "scripts" (post-install-cmd) feature of Composer to, after the installation of all packages, set up a git hook script that will run the phpcs checks on pre-commit. It's a pretty simple shell script that kicks back any errors it might find before the user can commit their changes.

0 comments voice your opinion now!
code standards composer git hook phpcs codesniffer install precommit

Link: http://engineering.zumba.com/2014/04/14/control-code-quality

blog comments powered by Disqus

Similar Posts

Juan Terminio's Blog: Setting Up a Debian VM, Step by Step

User Group: Seattle User Group Meeting Tonight (3rd) - PHP on Azure & Git

PHPMaster.com: 10 Tips for Better Coding

DevCentral Blog: Why Is Reusable Code So Hard to Secure?

Till Klampaeckel's Blog: Deploying PHP applications: PEAR and composer resources for chef


Community Events





Don't see your event here?
Let us know!


application podcast interview laravel configure release community developer code library unittest wordpress series install list language introduction testing threedevsandamaybe api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework