Skip to content

Commit

Permalink
Add support for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
endelwar committed Nov 4, 2024
1 parent 50e8f0c commit 5f4596a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 48 deletions.
54 changes: 17 additions & 37 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ on:

jobs:
phpstan:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php:
- '7.4'
- '8.2'
# - '8.3'
include:
- description: 'Symfony 5.4'
php: '7.4'
symfony: 5.4.*
- description: 'Symfony 6.3'
php: '8.2'
symfony: 6.3.*
# - description: 'Symfony 7.0'
# php: '8.3'
# symfony: 7.0.*
- description: 'Symfony 6.4'
php: '8.3'
symfony: 6.4.*
- description: 'Symfony 7.1'
php: '8.4'
symfony: 7.1.*
name: PHPStan - PHP ${{ matrix.php }} tests (${{ matrix.description }})
steps:
- name: Checkout
Expand All @@ -36,45 +32,29 @@ jobs:
- run: |
sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json;
- run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }}
- run: vendor/bin/phpstan analyse -c phpstan.neon.dist --error-format=github
- run: vendor/bin/phpstan analyse -c phpstan.dist.neon --error-format=github

cs-fixer:
runs-on: ubuntu-20.04
name: PHP-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fix CS
uses: docker://oskarstark/php-cs-fixer-ga
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
include:
- description: 'Symfony 5.4'
php: '7.4'
symfony: 5.4.*
symfony: '5.4.*'
composer_option: '--prefer-lowest'
- description: 'Symfony 5.4'
php: '8.2'
symfony: 5.4.*
- description: 'Symfony 6.3'
php: '8.2'
symfony: 6.3
php: '8.3'
symfony: '5.4.*'
- description: 'Symfony 6.4'
php: '8.2'
symfony: 6.4
- description: 'Symfony 7.0'
php: '8.3'
symfony: 7.0
symfony: '6.4'
- description: 'Symfony 7.1'
php: '8.3'
symfony: 7.1
symfony: '7.1'
- description: 'Symfony 7.2'
php: '8.4'
symfony: '7.2.x-dev'

name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
steps:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on: [push, pull_request]
name: Lint
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --diff --dry-run -vvv
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => false,
],
'trailing_comma_in_multiline' => ['elements' => ['array_destructuring', 'arrays', 'match']],
])
->setFinder($finder)
;
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
- Added support for PHP 8.4

## 2.2.0 - 2024-06-21
### Changed
- Resolve Symfony 7.1 deprecation
- Resolve Symfony 7.1 deprecation

## 2.1.0 - 2023-11-20
### Changed
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.* || 8.3.*",
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*",
"pontedilana/php-weasyprint": "^1.0",
"symfony/config": "^5.4 || ^6.3 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.3 || ^7.0",
Expand All @@ -25,12 +25,12 @@
},
"require-dev": {
"doctrine/annotations": "^1.11 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.13",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.2",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^3.64",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-symfony": "^1.4",
"phpunit/phpunit": "^9.6",
"symfony/framework-bundle": "^5.4 || ^6.3 || ^7.0",
"symfony/phpunit-bridge": "^5.4 || ^6.3 || ^7.0",
"symfony/validator": "^5.4 || ^6.3 || ^7.0",
Expand All @@ -57,6 +57,6 @@
"check-cs": "vendor/bin/php-cs-fixer fix --diff --dry-run --verbose",
"fix-cs": "vendor/bin/php-cs-fixer fix --verbose",
"static-analysis": "vendor/bin/phpstan analyse --ansi",
"test": "vendor/bin/simple-phpunit"
"test": "vendor/bin/phpunit"
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</exclude>
</coverage>
<php>
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
<server name="SYMFONY_PHPUNIT_VERSION" value="9.6"/>
</php>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
Expand Down
2 changes: 1 addition & 1 deletion src/WeasyPrint/Response/WeasyPrintResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
ResponseHeaderBag::DISPOSITION_ATTACHMENT,
];
if (!\in_array($contentDisposition, $contentDispositionDirectives, true)) {
throw new \InvalidArgumentException(sprintf('Expected one of the following directives: "%s", but "%s" given.', implode('", "', $contentDispositionDirectives), $contentDisposition));
throw new \InvalidArgumentException(\sprintf('Expected one of the following directives: "%s", but "%s" given.', implode('", "', $contentDispositionDirectives), $contentDisposition));
}

parent::__construct($content, $status, $headers);
Expand Down

0 comments on commit 5f4596a

Please sign in to comment.