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

Steve Azzopardi:
Setting up GrumPHP with Laravel
Aug 02, 2016 @ 17:17:11

On his Medium blog Steve Azzopardi has a tutorial showing you how to install and use the GrumPHP tool to evaluate the quality of the code in your Laravel-based codebase.

First of lets go through what is GrumPHP and how it can help in our workflow to make pull requests less “Code Check Styles” and more proper architecture review. There are specifically built tools for code style checks such as nitpick or styleCI, but even tools like these will only help you after you push your code to GitHub. GrumPHP will do all the style checks and other tasks, such as run PHPunit before you do a commit.

He expects a few prerequisites to already be installed but they're pretty minimal (basically Composer and Git). He then makes a brand new Laravel application and (optionally) sets up a development environment in a Vagrant VM. Next he pulls in GrumPHP and executes it, showing the happy green "grump" as there's no code defined to test. Next he adds in PSR-2 format testing with PHP_CodeSniffer and shows the unhappy red "grump" that results from bad code. He then adds in PHPUnit testing and adds in a gulp task to load other required resources.

tagged: grumphp testing laravel tutorial installation configuration

Link: https://medium.com/@steveazz/setting-up-grumphp-with-laravel-202f158e9862#.id38p25bs


Trending Topics: