Skip to content

Commit

Permalink
feat: php 8.3 support
Browse files Browse the repository at this point in the history
* feat: Add PHP 8.3 to composer.json

chore: coding-standards

chore: bump ergebnis/php-cs-fixer-config to 6.11.0

fix: PHP-CS-Fixer ruleset creation

chore: bump other packages

* chore: remove unused reference

* fix: Psalm errors

* Apply php-cs-fixer changes

* fix: IntegrationTestCase unlink tmp file on setUp

fix: Workflow actions to use latest versions

* Apply php-cs-fixer changes

* fix: disable PhpCsFixerCustomFixers/phpdoc_array_style breaking psalm check

* chore: include nyholm/psr7 and nyholm/psr7-server to resolve RuntimeException for PSR-17 ResponseFactory implementations

* fix: PHP-CS-Fixer and Psalm

---------

Co-authored-by: sweptsquash <[email protected]>
  • Loading branch information
sweptsquash and sweptsquash authored Jan 5, 2024
1 parent 34e38b9 commit 02772af
Show file tree
Hide file tree
Showing 44 changed files with 1,182 additions and 939 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
6 changes: 3 additions & 3 deletions .github/workflows/fix-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v5.1
uses: tj-actions/branch-names@v7

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand All @@ -28,6 +28,6 @@ jobs:
run: ./vendor/bin/php-cs-fixer fix --allow-risky=yes --using-cache=no

- name: Commit style fixes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply php-cs-fixer changes
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Puppeteer
run: npm install puppeteer
Expand All @@ -33,12 +33,12 @@ jobs:

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v3"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
path: "${{ steps.determine-composer-cache-directory.outputs.dir }}"
key: "php-${{ matrix.php }}-composer-${{ matrix.dependency-version }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php }}-composer-${{ matrix.dependency-version }}-"

Expand Down
31 changes: 17 additions & 14 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Ergebnis\PhpCsFixer\Config;
use PhpCsFixer\RuleSet\RuleSet;

$header = <<<EOF
Copyright (c) 2023 Kai Sassnowski
Expand All @@ -12,20 +11,24 @@
@see https://github.com/roach-php/roach
EOF;

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php80($header), [
'php_unit_test_class_requires_covers' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
$ruleSet = Config\RuleSet\Php80::create()
->withHeader($header)
->withRules(Config\Rules::fromArray([
'php_unit_test_class_requires_covers' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
],
],
],
'error_suppression' => [
'noise_remaining_usages' => false,
],
]);
'error_suppression' => [
'noise_remaining_usages' => false,
],
]));

$config = Config\Factory::fromRuleSet($ruleSet);

$config->getFinder()->in(__DIR__);
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php-cs-fixer.cache');
Expand Down
38 changes: 20 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,32 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0",
"guzzlehttp/guzzle": "^7.4.5",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"guzzlehttp/guzzle": "^7.8.0",
"jakeasmith/http_build_url": "^1.0.1",
"league/container": "^4.2",
"monolog/monolog": "^3.1",
"psr/container": "^2.0",
"psy/psysh": "^0.11.12",
"spatie/robots-txt": "^2.0",
"symfony/console": "^6.0",
"symfony/css-selector": "^6.0",
"symfony/dom-crawler": "^6.0",
"symfony/event-dispatcher": "^6.0",
"symfony/options-resolver": "^6.0"
"monolog/monolog": "^3.5",
"nyholm/psr7": "^1.8.1",
"nyholm/psr7-server": "^1.1",
"psr/container": "^2.0.2",
"psy/psysh": "^0.11.22",
"spatie/robots-txt": "^2.0.3",
"symfony/console": "^6.3.8",
"symfony/css-selector": "^6.3.2",
"symfony/dom-crawler": "^6.3.4",
"symfony/event-dispatcher": "^6.3.2",
"symfony/options-resolver": "^6.3"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.15",
"ergebnis/php-cs-fixer-config": "^5.3",
"ergebnis/composer-normalize": "^2.39",
"ergebnis/php-cs-fixer-config": "^6.11.0",
"http-interop/http-factory-guzzle": "^1.2",
"phpunit/phpunit": "^10.0",
"psr/http-message": "^1.0.1",
"phpunit/phpunit": "^10.4.2",
"psr/http-message": "^1.1.0",
"roave/security-advisories": "dev-latest",
"slim/slim": "^4.8",
"spatie/browsershot": "^3.57.4",
"vimeo/psalm": "^5.6"
"slim/slim": "^4.12",
"spatie/browsershot": "^3.60.0",
"vimeo/psalm": "^5.16"
},
"suggest": {
"spatie/browsershot": "Required to execute Javascript in spiders"
Expand Down
Loading

0 comments on commit 02772af

Please sign in to comment.