Skip to content

Commit b332a57

Browse files
committed
Drop Symfony 6.4 support, require ^7.3|^8.0
- Update all composer.json files to require Symfony ^7.3|^8.0 - Update symfony/type-info to ^7.3|^8.0 - Adjust GitHub Actions test matrix: - Replace Symfony 6.4 test with Symfony 7.4 LTS - Add explicit Symfony 8.0 test - Update SYMFONY_REQUIRE baseline to >=7.3 - Remove Symfony 6.4 compatibility code: - Remove unnecessary try-catch blocks for JsonException - Replace custom jsonMockResponseFromFile helper with built-in JsonMockResponse::fromFile - Clean up compatibility comments
1 parent 5aca06b commit b332a57

File tree

16 files changed

+73
-111
lines changed

16 files changed

+73
-111
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ jobs:
3030
# lowest deps
3131
- php-version: '8.2'
3232
dependency-version: 'lowest'
33-
# LTS version of Symfony
33+
# Symfony 7.4 LTS
3434
- php-version: '8.2'
35-
symfony-version: '6.4.*'
35+
symfony-version: '7.4.*'
36+
# Symfony 8.0
37+
- php-version: '8.3'
38+
symfony-version: '8.0.*'
3639

3740
env:
38-
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}
41+
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.3' }}
3942

4043
steps:
4144
- uses: actions/checkout@v4

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"require-dev": {
99
"php": ">=8.2",
1010
"php-cs-fixer/shim": "^3.75",
11-
"symfony/finder": "^6.4 || ^7.0",
12-
"symfony/filesystem": "^6.4 || ^7.0"
11+
"symfony/finder": "^7.3|^8.0",
12+
"symfony/filesystem": "^7.3|^8.0"
1313
},
1414
"config": {
1515
"sort-packages": true

examples/composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"symfony/ai-agent": "@dev",
1616
"symfony/ai-platform": "@dev",
1717
"symfony/ai-store": "@dev",
18-
"symfony/console": "^6.4|^7.0",
19-
"symfony/css-selector": "^6.4|^7.0",
20-
"symfony/dom-crawler": "^6.4|^7.0",
21-
"symfony/dotenv": "^6.4|^7.0",
22-
"symfony/event-dispatcher": "^6.4|^7.0",
23-
"symfony/filesystem": "^6.4|^7.0",
24-
"symfony/finder": "^6.4|^7.0",
25-
"symfony/process": "^6.4|^7.0",
26-
"symfony/var-dumper": "^6.4|^7.0"
18+
"symfony/console": "^7.3|^8.0",
19+
"symfony/css-selector": "^7.3|^8.0",
20+
"symfony/dom-crawler": "^7.3|^8.0",
21+
"symfony/dotenv": "^7.3|^8.0",
22+
"symfony/event-dispatcher": "^7.3|^8.0",
23+
"symfony/filesystem": "^7.3|^8.0",
24+
"symfony/finder": "^7.3|^8.0",
25+
"symfony/process": "^7.3|^8.0",
26+
"symfony/var-dumper": "^7.3|^8.0"
2727
},
2828
"autoload": {
2929
"psr-4": {

src/agent/composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@
2525
"phpstan/phpdoc-parser": "^2.1",
2626
"psr/log": "^3.0",
2727
"symfony/ai-platform": "@dev",
28-
"symfony/clock": "^6.4 || ^7.1",
29-
"symfony/http-client": "^6.4 || ^7.1",
30-
"symfony/property-access": "^6.4 || ^7.1",
31-
"symfony/property-info": "^6.4 || ^7.1",
32-
"symfony/serializer": "^6.4 || ^7.1",
33-
"symfony/type-info": "^7.2.3"
28+
"symfony/clock": "^7.3|^8.0",
29+
"symfony/http-client": "^7.3|^8.0",
30+
"symfony/property-access": "^7.3|^8.0",
31+
"symfony/property-info": "^7.3|^8.0",
32+
"symfony/serializer": "^7.3|^8.0",
33+
"symfony/type-info": "^7.3|^8.0"
3434
},
3535
"require-dev": {
3636
"mrmysql/youtube-transcript": "^v0.0.5",
3737
"phpstan/phpstan": "^2.0",
3838
"phpunit/phpunit": "^11.5.13",
3939
"symfony/ai-store": "@dev",
40-
"symfony/cache": "^6.4 || ^7.1",
41-
"symfony/css-selector": "^6.4 || ^7.1",
42-
"symfony/dom-crawler": "^6.4 || ^7.1",
43-
"symfony/event-dispatcher": "^6.4 || ^7.1",
44-
"symfony/http-foundation": "^6.4 || ^7.1"
40+
"symfony/cache": "^7.3|^8.0",
41+
"symfony/css-selector": "^7.3|^8.0",
42+
"symfony/dom-crawler": "^7.3|^8.0",
43+
"symfony/event-dispatcher": "^7.3|^8.0",
44+
"symfony/http-foundation": "^7.3|^8.0"
4545
},
4646
"config": {
4747
"sort-packages": true

src/agent/tests/Toolbox/Tool/BraveTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class BraveTest extends TestCase
2323
{
2424
public function testReturnsSearchResults()
2525
{
26-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/brave.json');
26+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/brave.json');
2727
$httpClient = new MockHttpClient($result);
2828
$brave = new Brave($httpClient, 'test-api-key');
2929

@@ -40,7 +40,7 @@ public function testReturnsSearchResults()
4040

4141
public function testPassesCorrectParametersToApi()
4242
{
43-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/brave.json');
43+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/brave.json');
4444
$httpClient = new MockHttpClient($result);
4545
$brave = new Brave($httpClient, 'test-api-key', ['extra' => 'option']);
4646

@@ -67,12 +67,4 @@ public function testHandlesEmptyResults()
6767

6868
$this->assertEmpty($results);
6969
}
70-
71-
/**
72-
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
73-
*/
74-
private function jsonMockResponseFromFile(string $file): JsonMockResponse
75-
{
76-
return new JsonMockResponse(json_decode(file_get_contents($file), true));
77-
}
7870
}

src/agent/tests/Toolbox/Tool/OpenMeteoTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class OpenMeteoTest extends TestCase
2222
{
2323
public function testCurrent()
2424
{
25-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/openmeteo-current.json');
25+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/openmeteo-current.json');
2626
$httpClient = new MockHttpClient($result);
2727

2828
$openMeteo = new OpenMeteo($httpClient);
@@ -40,7 +40,7 @@ public function testCurrent()
4040

4141
public function testForecast()
4242
{
43-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/openmeteo-forecast.json');
43+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/openmeteo-forecast.json');
4444
$httpClient = new MockHttpClient($result);
4545

4646
$openMeteo = new OpenMeteo($httpClient);
@@ -69,12 +69,4 @@ public function testForecast()
6969

7070
$this->assertSame($expected, $actual);
7171
}
72-
73-
/**
74-
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
75-
*/
76-
private function jsonMockResponseFromFile(string $file): JsonMockResponse
77-
{
78-
return new JsonMockResponse(json_decode(file_get_contents($file), true));
79-
}
8072
}

src/agent/tests/Toolbox/Tool/WikipediaTest.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class WikipediaTest extends TestCase
2222
{
2323
public function testSearchWithResults()
2424
{
25-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-search-result.json');
25+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-search-result.json');
2626
$httpClient = new MockHttpClient($result);
2727

2828
$wikipedia = new Wikipedia($httpClient);
@@ -49,7 +49,7 @@ public function testSearchWithResults()
4949

5050
public function testSearchWithoutResults()
5151
{
52-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-search-empty.json');
52+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-search-empty.json');
5353
$httpClient = new MockHttpClient($result);
5454

5555
$wikipedia = new Wikipedia($httpClient);
@@ -62,7 +62,7 @@ public function testSearchWithoutResults()
6262

6363
public function testArticleWithResult()
6464
{
65-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-article.json');
65+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article.json');
6666
$httpClient = new MockHttpClient($result);
6767

6868
$wikipedia = new Wikipedia($httpClient);
@@ -78,7 +78,7 @@ public function testArticleWithResult()
7878

7979
public function testArticleWithRedirect()
8080
{
81-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-article-redirect.json');
81+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article-redirect.json');
8282
$httpClient = new MockHttpClient($result);
8383

8484
$wikipedia = new Wikipedia($httpClient);
@@ -96,7 +96,7 @@ public function testArticleWithRedirect()
9696

9797
public function testArticleMissing()
9898
{
99-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-article-missing.json');
99+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-article-missing.json');
100100
$httpClient = new MockHttpClient($result);
101101

102102
$wikipedia = new Wikipedia($httpClient);
@@ -106,12 +106,4 @@ public function testArticleMissing()
106106

107107
$this->assertSame($expected, $actual);
108108
}
109-
110-
/**
111-
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
112-
*/
113-
private function jsonMockResponseFromFile(string $file): JsonMockResponse
114-
{
115-
return new JsonMockResponse(json_decode(file_get_contents($file), true));
116-
}
117109
}

src/ai-bundle/composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"symfony/ai-agent": "@dev",
1919
"symfony/ai-platform": "@dev",
2020
"symfony/ai-store": "@dev",
21-
"symfony/config": "^6.4 || ^7.0",
22-
"symfony/dependency-injection": "^6.4 || ^7.0",
23-
"symfony/framework-bundle": "^6.4 || ^7.0",
24-
"symfony/string": "^6.4 || ^7.0"
21+
"symfony/config": "^7.3|^8.0",
22+
"symfony/dependency-injection": "^7.3|^8.0",
23+
"symfony/framework-bundle": "^7.3|^8.0",
24+
"symfony/string": "^7.3|^8.0"
2525
},
2626
"require-dev": {
2727
"phpstan/phpstan": "^2.1",
2828
"phpunit/phpunit": "^11.5",
29-
"symfony/expression-language": "^6.4 || ^7.0",
30-
"symfony/security-core": "^6.4 || ^7.0"
29+
"symfony/expression-language": "^7.3|^8.0",
30+
"symfony/security-core": "^7.3|^8.0"
3131
},
3232
"config": {
3333
"sort-packages": true

src/mcp-bundle/composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
}
1111
],
1212
"require": {
13-
"symfony/config": "^6.4 || ^7.0",
14-
"symfony/console": "^6.4 || ^7.0",
15-
"symfony/dependency-injection": "^6.4 || ^7.0",
16-
"symfony/framework-bundle": "^6.4 || ^7.0",
17-
"symfony/http-foundation": "^6.4 || ^7.0",
18-
"symfony/http-kernel": "^6.4 || ^7.0",
13+
"symfony/config": "^7.3|^8.0",
14+
"symfony/console": "^7.3|^8.0",
15+
"symfony/dependency-injection": "^7.3|^8.0",
16+
"symfony/framework-bundle": "^7.3|^8.0",
17+
"symfony/http-foundation": "^7.3|^8.0",
18+
"symfony/http-kernel": "^7.3|^8.0",
1919
"symfony/mcp-sdk": "@dev",
20-
"symfony/routing": "^6.4 || ^7.0"
20+
"symfony/routing": "^7.3|^8.0"
2121
},
2222
"require-dev": {
2323
"phpstan/phpstan": "^2.1",

src/mcp-sdk/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
"require": {
1717
"php": "^8.2",
1818
"psr/log": "^1.0 || ^2.0 || ^3.0",
19-
"symfony/uid": "^6.4 || ^7.0"
19+
"symfony/uid": "^7.3|^8.0"
2020
},
2121
"require-dev": {
2222
"phpstan/phpstan": "^2.1",
2323
"phpunit/phpunit": "^11.5",
24-
"symfony/console": "^6.4 || ^7.0",
24+
"symfony/console": "^7.3|^8.0",
25+
"rector/rector": "^2.0",
2526
"psr/cache": "^3.0"
2627
},
2728
"suggest": {

0 commit comments

Comments
 (0)