Skip to content

Commit

Permalink
Merge pull request #18 from jakzal/php-8.1
Browse files Browse the repository at this point in the history
Enable PHP 8.1 support
  • Loading branch information
jakzal committed Jan 17, 2022
2 parents b31358d + 73ee1d4 commit b006a14
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
name: Build and test
strategy:
matrix:
php: [7.4, 8.0]
php: ['8.0', '8.1']
deps: [high]
include:
- php: 8.0
- php: '8.1'
deps: low

steps:
Expand All @@ -42,7 +42,7 @@ jobs:

- name: Upload the phar
uses: actions/upload-artifact@v1
if: matrix.php == '7.4' && matrix.deps == 'high'
if: matrix.php == '8.0' && matrix.deps == 'high'
with:
name: zalas-phpunit-doubles-extension.phar
path: build/zalas-phpunit-doubles-extension.phar
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit: true
build:
environment:
php:
version: 7.4
version: 8.0
tests:
override:
- make test
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IS_PHP8:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.0", ">=");')
IS_PHP81:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.1", ">=");')

default: build

Expand Down Expand Up @@ -27,23 +27,23 @@ test: vendor cs deptrac phpunit infection
test-min: update-min cs deptrac phpunit infection
.PHONY: test-min

ifeq ($(IS_PHP8),1)
ifeq ($(IS_PHP81),1)
test-package:
else
test-package: package test-package-tools
cd tests/phar && ./tools/phpunit
endif
.PHONY: test-package

ifeq ($(IS_PHP8),1)
ifeq ($(IS_PHP81),1)
cs:
else
cs: tools/php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
endif
.PHONY: cs

ifeq ($(IS_PHP8),1)
ifeq ($(IS_PHP81),1)
cs-fix:
else
cs-fix: tools/php-cs-fixer
Expand All @@ -52,7 +52,7 @@ cs-fix: tools/php-cs-fixer
endif

deptrac: tools/deptrac
tools/deptrac --no-interaction --ansi --formatter-graphviz-display=0
tools/deptrac --no-interaction --ansi
.PHONY: deptrac

infection: tools/infection tools/infection.pubkey
Expand Down Expand Up @@ -80,7 +80,7 @@ clean:
find tests/phar/tools -not -path '*/\.*' -type f -delete
.PHONY: clean

ifeq ($(IS_PHP8),1)
ifeq ($(IS_PHP81),1)
package:
else
package: tools/box
Expand All @@ -92,7 +92,7 @@ package: tools/box

cd build/phar && \
composer remove phpunit/phpunit --no-update && \
composer config platform.php 7.4 && \
composer config platform.php 8.0 && \
composer update --no-dev -o -a

tools/box compile
Expand All @@ -112,16 +112,16 @@ tools/php-cs-fixer:
curl -Ls http://cs.symfony.com/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer

tools/deptrac:
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.10.0/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.19.1/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac

tools/infection: tools/infection.pubkey
curl -Ls https://github.com/infection/infection/releases/download/0.20.2/infection.phar -o tools/infection && chmod +x tools/infection
curl -Ls https://github.com/infection/infection/releases/download/0.26.1/infection.phar -o tools/infection && chmod +x tools/infection

tools/infection.pubkey:
curl -Ls https://github.com/infection/infection/releases/download/0.20.2/infection.phar.pubkey -o tools/infection.pubkey
curl -Ls https://github.com/infection/infection/releases/download/0.26.1/infection.phar.pubkey -o tools/infection.pubkey

tools/box:
curl -Ls https://github.com/humbug/box/releases/download/3.10.0/box.phar -o tools/box && chmod +x tools/box
curl -Ls https://github.com/humbug/box/releases/download/3.14.0/box.phar -o tools/box && chmod +x tools/box

tests/phar/tools/phpunit:
curl -Ls https://phar.phpunit.de/phpunit-9.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Initialises test doubles in PHPUnit test cases for you",
"type": "library",
"require": {
"php": "^7.4 || ~8.0.0",
"php": "~8.0.0 || ~8.1.0",
"phpunit/phpunit": "^9.0",
"phpdocumentor/reflection-docblock": "^5.2"
},
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
</copyright>

<requires>
<php version="^7.4"/>
<php version="^8.0"/>
</requires>
</phar>

0 comments on commit b006a14

Please sign in to comment.