Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Sander de Wijs
Courses Plus Student 22,267 PointsInstall PHP codesniffer on windows
When following along with Phil Sturgeon I ran into an issue installing PHP codesniffer on my Windows 7 machine.
When I want to run composer in my testproject, I get the following error:
c:\wamp\www\groupdeal>php ./vendor/bin/phpcs modals --standard=PSR2
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../squizlabs/php_codesniffer/scripts"
BIN_TARGET="`pwd`/phpcs"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"
The steps I have taken before this:
Add PHP to the Windows Path so I can use PHP with the command line.
Install composer via the Windows installer. (This required editing the PHP.ini file to activate open_ssl)
Install PHP sniffer using composer in my project folder.
The code I want to sniff is in the modals folder
Sander de Wijs
Courses Plus Student 22,267 PointsSander de Wijs
Courses Plus Student 22,267 PointsI found a workaround by installing the PHPcs package for sublime text. This automaticaly checks for code standards while typing and on file save.
First I installed PEAR in my PHP folder. After that I installed PHP_codesniffer using PEAR.
Now I can use codesniffer directly in all my PHP projects with Sublime Text.