Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-support Symfony 4 and 5 #99

Merged
merged 8 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,23 @@ jobs:

strategy:
matrix:
php: [8.0, 8.1]
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
symfony: [4.x, 5.x, 6.x]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]

name: PHP${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
exclude:
- symfony: 5.x
php: 7.1
- symfony: 6.x
php: 7.1
- symfony: 6.x
php: 7.2
- symfony: 6.x
php: 7.3
- symfony: 6.x
php: 7.4

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

steps:
- name: Checkout code
Expand All @@ -28,7 +40,8 @@ jobs:

- name: Install dependencies
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer require "symfony/http-foundation:${{ matrix.symfony }}" "symfony/http-kernel:${{ matrix.symfony }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest --with-all-dependencies

- name: Execute Unit Tests
run: vendor/bin/phpunit
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
],
"require": {
"php": "^8.0",
"symfony/http-foundation": "^6",
"symfony/http-kernel": "^6"
"php": "^7.1.3|^8.0",
"symfony/http-foundation": "^4|^5|^6",
"symfony/http-kernel": "^4|^5|^6"
},
"require-dev": {
"phpunit/phpunit": "^9",
"phpunit/phpunit": "^7|^9",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
Expand Down
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, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $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, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): Response
{
$response = new Response();

Expand Down