Skip to content

Commit

Permalink
Support Symfony 7. (#104)
Browse files Browse the repository at this point in the history
* Support Symfony 7.

* Update php versions

* Update run-tests.yml

* Test 8.3

* Add argument types.

---------

Co-authored-by: Barry vd. Heuvel <barryvdh@gmail.com>
  • Loading branch information
longwave and barryvdh authored Nov 14, 2023
1 parent 57bd918 commit 4d6312c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,38 @@ on:

jobs:
php-tests:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

strategy:
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1]
symfony: [4.x, 5.x, 6.x]
php: [8.1, 8.2, 8.3]
symfony: [6.x]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]
exclude:
- symfony: 6.x
php: 7.2
- symfony: 6.x
include:
- symfony: ^5.3
php: 7.3
- symfony: 6.x
dependency-version: prefer-lowest
- symfony: ^5.3
php: 7.3
dependency-version: prefer-stable
- symfony: ^5.3
php: 7.4

name: PHP${{ matrix.php }} Symfony${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
dependency-version: prefer-stable
- symfony: ^5.3
php: 8.1
dependency-version: prefer-stable
- symfony: ^7
php: 8.2
dependency-version: prefer-lowest
- symfony: ^7
php: 8.2
dependency-version: prefer-stable
- symfony: ^7
php: 8.3
dependency-version: prefer-stable

name: PHP${{ matrix.php }} Symfony${{ matrix.symfony }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
],
"require": {
"php": "^7.2|^8.0",
"symfony/http-foundation": "^4|^5|^6",
"symfony/http-kernel": "^4|^5|^6"
"php": "^7.3|^8.0",
"symfony/http-foundation": "^5.3|^6|^7",
"symfony/http-kernel": "^5.3|^6|^7"
},
"require-dev": {
"phpunit/phpunit": "^7|^9",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
Expand All @@ -39,5 +39,7 @@
"branch-alias": {
"dev-master": "2.1-dev"
}
}
},
"minimum-stability": "beta",
"prefer-stable": true
}
2 changes: 1 addition & 1 deletion src/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(HttpKernelInterface $app, array $options = [])
$this->cors = new CorsService(array_merge($this->defaultOptions, $options));
}

public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
{
if ($this->cors->isPreflightRequest($request)) {
$response = $this->cors->handlePreflightRequest($request);
Expand Down
2 changes: 1 addition & 1 deletion tests/MockApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(array $responseHeaders)
$this->responseHeaders = $responseHeaders;
}

public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
{
$response = new Response();

Expand Down

0 comments on commit 4d6312c

Please sign in to comment.