Skip to content

Commit bda36eb

Browse files
authored
Re-support Symfony 4 and 5 (#99)
* Test Symfony 4,5,6 * Use signature for both new and old versions
1 parent 1faf1a9 commit bda36eb

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.github/workflows/run-tests.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
php: [8.0, 8.1]
13+
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
14+
symfony: [4.x, 5.x, 6.x]
1415
dependency-version: [prefer-lowest, prefer-stable]
1516
os: [ubuntu-latest]
16-
17-
name: PHP${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
17+
exclude:
18+
- symfony: 5.x
19+
php: 7.1
20+
- symfony: 6.x
21+
php: 7.1
22+
- symfony: 6.x
23+
php: 7.2
24+
- symfony: 6.x
25+
php: 7.3
26+
- symfony: 6.x
27+
php: 7.4
28+
29+
name: PHP${{ matrix.php }} Symfony${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
1830

1931
steps:
2032
- name: Checkout code
@@ -28,7 +40,8 @@ jobs:
2840

2941
- name: Install dependencies
3042
run: |
31-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
43+
composer require "symfony/http-foundation:${{ matrix.symfony }}" "symfony/http-kernel:${{ matrix.symfony }}" --no-interaction --no-update
44+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest --with-all-dependencies
3245
3346
- name: Execute Unit Tests
3447
run: vendor/bin/phpunit

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^8.0",
16-
"symfony/http-foundation": "^6",
17-
"symfony/http-kernel": "^6"
15+
"php": "^7.1.3|^8.0",
16+
"symfony/http-foundation": "^4|^5|^6",
17+
"symfony/http-kernel": "^4|^5|^6"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^9",
20+
"phpunit/phpunit": "^7|^9",
2121
"squizlabs/php_codesniffer": "^3.5"
2222
},
2323
"autoload": {

src/Cors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(HttpKernelInterface $app, array $options = [])
4343
$this->cors = new CorsService(array_merge($this->defaultOptions, $options));
4444
}
4545

46-
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
46+
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response
4747
{
4848
if ($this->cors->isPreflightRequest($request)) {
4949
$response = $this->cors->handlePreflightRequest($request);

tests/MockApp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct(array $responseHeaders)
1616
$this->responseHeaders = $responseHeaders;
1717
}
1818

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

0 commit comments

Comments
 (0)