Skip to content

Commit

Permalink
Merge pull request #21 from pixelfederation/php8
Browse files Browse the repository at this point in the history
added php8 support
  • Loading branch information
Martin Fris authored Dec 15, 2021
2 parents bd6a404 + e465405 commit 0de2703
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.4' ] # , '8.0' PHP 8 is not supported yet
php-versions: [ '7.4', '8.0' ]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
run: composer run-script lic-check

- name: Run static analysis (GrumPHP)
run: composer run-script grumphp
run: composer run-script grumphp${{ matrix.php-versions }}

dependabot:
needs: [ build ]
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.4",
"php": ">=7.4",
"ackintosh/ganesha": "^2.0",
"beberlei/assert": "^3.3",
"doctrine/annotations": "^1.12",
Expand Down Expand Up @@ -56,7 +56,8 @@
"sort-packages": true
},
"scripts": {
"grumphp": "grumphp run",
"grumphp7.4": "grumphp run --testsuite=php7.4",
"grumphp8.0": "grumphp run --testsuite=php8.0",
"lic-check": "license-checker check",
"phpcs": "phpcs --standard=phpcs.ruleset.xml src",
"phpcbf": "phpcbf --standard=phpcs.ruleset.xml --extensions=php --tab-width=4 -sp src tests",
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

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

2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
build: ./docker/php
volumes:
- .:/srv/www:delegated
- ~/.composer:/root/.composer
environment:
- XDEBUG_CONFIG=idekey=PHPSTORM
- COMPOSER_MEMORY_LIMIT=-1
Expand All @@ -16,6 +17,7 @@ services:
build: ./docker/php8
volumes:
- .:/srv/www:delegated
- ~/.composer:/root/.composer
environment:
- XDEBUG_CONFIG=idekey=PHPSTORM
- COMPOSER_MEMORY_LIMIT=-1
26 changes: 25 additions & 1 deletion grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ grumphp:
process_timeout: 600
git_hook_variables:
EXEC_GRUMPHP_COMMAND: './bin/grumphp_hooks/environment_spinup && docker exec -i circuit-breaker-bundle-php7'
testsuites:
php7.4:
tasks:
- phpcs
- phpmd
- phpcsfixer2
- phpparser
- phplint
- phpunit
- phpversion
- shell
- phpstan
- psalm
php8.0:
tasks:
- phpmd
- phpcsfixer2
- phpparser
- phpunit
- phpversion
- shell
- phpstan
- psalm
tasks:
phpcs:
standard: 'phpcs.ruleset.xml'
Expand Down Expand Up @@ -41,7 +64,8 @@ grumphp:
phplint:
exclude: [ 'vendor' ]
phpunit: ~
phpversion: ~
phpversion:
project: '7.4'
shell: ~
phpstan:
autoload_file: ~
Expand Down
1 change: 1 addition & 0 deletions src/Instantiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private function getCallback(
$serviceMethod,
$serviceMethods
) {
$params = array_values($params); // fix for php 8 and named parameters
/** @var Callable $callable */
$callable = [$instance, $method];
$invoker = static fn () => call_user_func_array($callable, $params);
Expand Down

0 comments on commit 0de2703

Please sign in to comment.