diff --git a/.travis.yml b/.travis.yml index 64d0d30..df5d788 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,15 @@ php: - 7.0 - 7.1 - 7.2 - - hhvm + - 7.3 -install: composer install --no-interaction --classmap-authoritative +install: + - composer install --no-interaction --classmap-authoritative + - composer require --no-interaction php-coveralls/php-coveralls:^2.0 -script: vendor/bin/phpunit --configuration phpunit.xml +script: + - chmod +x run-phpunit.sh + - ./run-phpunit.sh after_success: vendor/bin/php-coveralls --verbose diff --git a/README.md b/README.md index ced3b14..e0e7979 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://travis-ci.org/Ekman/Luhn-Algorithm.svg?branch=master)](https://travis-ci.org/Ekman/Luhn-Algorithm) [![Coverage Status](https://coveralls.io/repos/github/Ekman/Luhn-Algorithm/badge.svg)](https://coveralls.io/github/Ekman/Luhn-Algorithm) -This is an implementation of the Luhn Algorithm for PHP and HHVM. The Luhn Algorithm is +This is an implementation of the Luhn Algorithm for PHP. The Luhn Algorithm is used to validate things like credit cards and national identification numbers. More information on the algorithm can be found at [Wikipedia](http://en.wikipedia.org/wiki/Luhn_algorithm). diff --git a/composer.json b/composer.json index 9e40d07..7872385 100644 --- a/composer.json +++ b/composer.json @@ -35,10 +35,5 @@ }, "require": { "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0", - "friendsofphp/php-cs-fixer": "^2.0", - "php-coveralls/php-coveralls": "^2.0" } } diff --git a/run-php-cs-fixer.sh b/run-php-cs-fixer.sh new file mode 100644 index 0000000..ca32d67 --- /dev/null +++ b/run-php-cs-fixer.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# +# Runs code standard fixer without having the need to specify it as a +# Composer dependency. +# + +composer require --no-interaction friendsofphp/php-cs-fixer:^2.0 + +vendor/bin/php-cs-fixer --config=.php_cs.dist --no-interaction fix + +composer remove --no-interaction friendsofphp/php-cs-fixer diff --git a/run-phpunit.sh b/run-phpunit.sh new file mode 100644 index 0000000..ce45569 --- /dev/null +++ b/run-phpunit.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# +# Runs code standard fixer without having the need to specify it as a +# Composer dependency. +# + +if [ $TRAVIS ]; then + # No need to install PHPunit + phpunit --configuration phpunit.xml +else + composer require --no-interaction phpunit/phpunit:^6.0 + + vendor/bin/phpunit --configuration phpunit.xml + + composer remove --no-interaction phpunit/phpunit +fi; \ No newline at end of file