Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add phpcs to travis to check that code matches zend style #47

Closed
wants to merge 1 commit into from

3 participants

@jpiasetz

This adds CodeSniff to travis to complain when stuff gets off the style guide. Will need to be changed based on #43. I also updated it to use the git repo instead of downloading from sourceforge. The codesniff only needs to be run on one copy so so I force it on 5.5.

@michelle
Owner

Hmm, any idea why the first build fails with Fatal error: Class 'Phar' not found in /home/travis/.phpenv/versions/5.2.17/bin/composer.phar on line 13?

@jpiasetz

It's existing behaviour (it's happening on other builds as well). The probably changed what they have on php5.2 since the travis config was update. They have this warning http://docs.travis-ci.com/user/languages/php/#PHP-installation I could just not do much on 5.2?

@bkrausz
Owner

Added phpcs to the build (only on 5.6) based off of your diff, as well as fixing some style issues that built up over the last 3 months. Thanks!

@bkrausz bkrausz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 3 deletions.
  1. +5 −2 .travis.yml
  2. +2 −1  composer.json
View
7 .travis.yml
@@ -7,6 +7,9 @@ php:
- 5.5
before_script:
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then wget http://iweb.dl.sourceforge.net/project/simpletest/simpletest/simpletest_1.1/simpletest_1.1.0.tar.gz; tar xf simpletest_1.1.0.tar.gz -C test; else composer install --dev --prefer-source; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then pyrus install http://phptal.org/latest.tar.gz && pear install pear/PHP_CodeSniffer && phpenv rehash; fi"
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then git clone https://github.com/vierbergenlars/simpletest test/simpletest; else composer install --dev --prefer-source; fi"
-script: php test/Stripe.php
+script:
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then phpcs --standard=zend --encoding=UTF-8 --report=summary --ignore=*/vendor/* -p; fi"
+ - php test/Stripe.php
View
3  composer.json
@@ -21,7 +21,8 @@
"ext-mbstring": "*"
},
"require-dev": {
- "vierbergenlars/simpletest": "*"
+ "vierbergenlars/simpletest": "*",
+ "squizlabs/php_codesniffer": "*"
},
"autoload": {
"classmap": ["lib/Stripe/"]
Something went wrong with that request. Please try again.