Skip to content

Commit

Permalink
Merge pull request #306 from smalot/fix/enable-test-php8
Browse files Browse the repository at this point in the history
Allow PHP 8
  • Loading branch information
j0k3r authored Jun 8, 2020
2 parents 2f38955 + 55b9aa0 commit fb0ff39
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/.travis.yml export-ignore
/samples export-ignore
/src/Smalot/PdfParser/Tests export-ignore
/phpstan.neon export-ignore
23 changes: 13 additions & 10 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# For more information about code coverage
# See: https://scrutinizer-ci.com/docs/build/code_coverage
build:
nodes:
coverage:
tests:
override:
- command: vendor/bin/phpunit --coverage-clover coverage/clover.xml
coverage:
file: coverage/clover.xml
format: clover
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
-
command: SYMFONY_PHPUNIT_VERSION=7.5 php vendor/bin/simple-phpunit --coverage-clover coverage/clover.xml
coverage:
file: coverage/clover.xml
format: clover
environment:
php:
version: 7.4
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

jobs:
include:
- php: 7.2
env: SYMFONY_PHPUNIT_VERSION=7.5
- php: 7.3
env: SYMFONY_PHPUNIT_VERSION=7.5 COMPOSER_FLAGS="--prefer-lowest"
- php: 7.4
env: SYMFONY_PHPUNIT_VERSION=7.5 LINTER_RUN=run COVERAGE_FLAGS="--coverage-clover coverage/clover.xml"
- php: nightly
env: SYMFONY_PHPUNIT_VERSION=7.5
fast_finish: true
allow_failures:
- php: nightly
include:
- php: 7.4
env: COMPOSER_FLAGS="--prefer-lowest" LINTER_RUN=run COVERAGE_FLAGS="--coverage-clover coverage/clover.xml"

before_install:
- if [ "$LINTER_RUN" = "run" ]; then composer require phpstan/phpstan phpstan/phpstan-phpunit --dev --no-progress --no-suggest ; fi;
- if [ "$LINTER_RUN" != "run" ]; then composer remove friendsofphp/php-cs-fixer --dev --no-progress --no-update ; fi;

install:
- composer update --prefer-dist --no-progress --no-suggest --optimize-autoloader $COMPOSER_FLAGS
- php vendor/bin/simple-phpunit install

script:
- if [ "$LINTER_RUN" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
- if [ "$LINTER_RUN" = "run" ]; then composer require phpstan/phpstan --no-progress --no-suggest ; fi;
- if [ "$LINTER_RUN" = "run" ]; then php vendor/bin/phpstan analyse src test tests --no-progress --level 3 ; fi;
- php vendor/bin/phpunit $COVERAGE_FLAGS
- if [ "$LINTER_RUN" = "run" ]; then php vendor/bin/phpstan analyse src test tests --level 3 ; fi;
- php vendor/bin/simple-phpunit -v $COVERAGE_FLAGS
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"homepage": "http://www.pdfparser.org",
"require": {
"php": "^5.6|^7.0",
"php": ">=5.6",
"ext-mbstring": "*",
"ext-zlib": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7.27|^6",
"friendsofphp/php-cs-fixer": "^2.16.3"
"friendsofphp/php-cs-fixer": "^2.16.3",
"symfony/phpunit-bridge": "^4.2.3"
},
"autoload": {
"psr-0": {
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon

parameters:
# https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288
autoload_files:
- vendor/bin/.phpunit/phpunit-7.5-0/vendor/autoload.php

0 comments on commit fb0ff39

Please sign in to comment.