Skip to content

Commit

Permalink
Merge pull request #3 from tienvx/update-dependencies
Browse files Browse the repository at this point in the history
deps: Update dependencies (php, phpunit, symfony)
  • Loading branch information
tienvx committed Mar 28, 2024
2 parents fbf1c0b + 997ba25 commit 2de4564
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 50 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
dependency-versions: ['lowest', 'highest']
name: PHP ${{ matrix.php-versions }} with ${{ matrix.dependency-versions }} versions of Composer dependencies
php: ['8.1', '8.2', '8.3']
dependencies: ['lowest', 'highest']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpstan, php-cs-fixer:3
php-version: ${{ matrix.php }}
coverage: pcov

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install
uses: "ramsey/composer-install@v2"
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependency-versions }}
dependency-versions: ${{ matrix.dependencies }}

- name: Run PHP CS Fixer
run: php-cs-fixer fix --diff --dry-run
env:
PHP_CS_FIXER_IGNORE_ENV: 1
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run

- name: Run PHPStan
run: phpstan analyse src tests
uses: docker://oskarstark/phpstan-ga
env:
REQUIRE_DEV: true

- name: Test & Generate Code Coverage
run: ./vendor/bin/phpunit
Expand All @@ -43,4 +43,4 @@ jobs:
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=clover.xml -v
if: matrix.php-versions == '8.0'
if: ${{ github.event_name == 'push' && matrix.php == '8.1' && matrix.dependencies == 'highest' }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/.vscode/
/vendor/
/composer.lock
/.phpunit.result.cache
/.phpunit.cache
/clover.xml
/coveralls-upload.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class UserDispatcher implements DispatcherInterface
[version-image]: http://img.shields.io/packagist/v/tienvx/pact-messenger-bundle.svg?style=flat

[php-version-url]: https://packagist.org/packages/tienvx/pact-messenger-bundle
[php-version-image]: http://img.shields.io/badge/php-8.0.0+-ff69b4.svg
[php-version-image]: http://img.shields.io/badge/php-8.1.0+-ff69b4.svg

[messenger]: https://github.com/symfony/messenger
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"description": "Pact Messenger Bundle",
"type": "symfony-bundle",
"require": {
"php": "^8.0",
"symfony/http-kernel": "^4.4|^5.4|^6.0",
"symfony/dependency-injection": "^4.4|^5.4|^6.0",
"symfony/config": "^4.4|^5.4|^6.0",
"symfony/messenger": "^4.4|^5.4|^6.0"
"php": "^8.1",
"symfony/http-kernel": "^5.4|^6.4|^7.0",
"symfony/dependency-injection": "^5.4|^6.4|^7.0",
"symfony/config": "^5.4|^6.4|^7.0",
"symfony/messenger": "^5.4|^6.4|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.1"
},
"license": "MIT",
"autoload": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 0
paths:
- src
- tests
46 changes: 19 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
convertDeprecationsToExceptions="false"
>
<testsuites>
<testsuite name="unit">
<directory>tests</directory>
</testsuite>
</testsuites>

<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>

<exclude>
<directory suffix=".php">src/Resources</directory>
</exclude>

<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">src/Resources</directory>
</exclude>
</source>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function testLoad(): void
],
SendMessageToTransportsEventListener::class => [
'tag' => 'kernel.event_listener',
'args' => fn (array $args) => 1 === count($args) &&
EnvelopeCollectorInterface::class == $args[0],
'args' => fn (array $args) => 1 === count($args)
&& EnvelopeCollectorInterface::class == $args[0],
],
];
foreach ($services as $key => $value) {
Expand Down

0 comments on commit 2de4564

Please sign in to comment.