Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Use composer to install PHP_CodeSniffer
Browse files Browse the repository at this point in the history
This makes it possible to require a specific version, which is
necessary, because PHPCompatibility is not yet compatible with
PHP_CodeSniffer 3. See PHPCompatibility/PHPCompatibility#367.
  • Loading branch information
real-or-random committed May 7, 2017
1 parent 11ac606 commit 1a34979
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 12 deletions.
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,22 @@ before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/tr

install:
- sh travis.sh
- cd lib/plugins/icalevents && composer install && cd ../../..
- cd lib/plugins/icalevents && composer install --no-interaction && cd ../../..

before_script:
# Get latest release of PHP_CodeSniffer
- cd /tmp
- wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
- chmod +x phpcs.phar

# Get latest release of PHPCompatibility
- git clone -b master https://github.com/wimg/PHPCompatibility.git /tmp/phpcs-extra/PHPCompatibility
- cd /tmp/phpcs-extra/PHPCompatibility
- git checkout $(git describe --tags `git rev-list --tags --max-count=1`) # Checkout latest tag

- cd $TRAVIS_BUILD_DIR
- /tmp/phpcs.phar --config-set installed_paths /tmp/phpcs-extra
- lib/plugins/icalevents/vendor/bin/phpcs --config-set installed_paths /tmp/phpcs-extra

# A time zone without daylight saving time for simplified testing (UTC+09:00)
- echo 'date.timezone = "Asia/Tokyo"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

script:
- cd _test && phpunit --stderr --group plugin_icalevents && cd ..
# Ignore SplitTest.php. It's a false positive; PHPCompatibility does not understand namespaces.
- cd $TRAVIS_BUILD_DIR/lib/plugins/icalevents && /tmp/phpcs.phar --standard=PHPCompatibility --runtime-set testVersion 5.5-7.0 --ignore=_test/,vendor/sabre/uri/tests/SplitTest.php .
- cd $TRAVIS_BUILD_DIR/lib/plugins/icalevents && /tmp/phpcs.phar --standard=PHPCompatibility --runtime-set testVersion 5.3-5.4 --ignore=_test/,syntax-impl.php,vendor/ .
- cd $TRAVIS_BUILD_DIR/lib/plugins/icalevents && ./vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 5.5-7.0 --ignore=_test/,vendor/sabre/uri/tests/SplitTest.php .
- cd $TRAVIS_BUILD_DIR/lib/plugins/icalevents && ./vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 5.3-5.4 --ignore=_test/,syntax-impl.php,vendor/ .
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ all:

dist:
git archive HEAD -o $(package_name)-$(version).zip
composer install --ignore-platform-reqs --no-dev
composer install --no-dev
rm -rf vendor/bin
zip -r $(package_name)-$(version).zip vendor
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
},
"require": {
"sabre/vobject": "~4.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "~2"
}
}
83 changes: 81 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a34979

Please sign in to comment.