Skip to content

Commit 264b4e3

Browse files
committed
feature #277 Drop Symfony 6.4 support, require ^7.3|^8.0 (OskarStark)
This PR was squashed before being merged into the main branch. Discussion ---------- Drop Symfony 6.4 support, require ^7.3|^8.0 | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | -- | License | MIT - Update all composer.json files to require Symfony ^7.3|^8.0 - Minimum supported version is now Symfony 7.3 LTS Needs - [x] CodeWithKyrian/transformers-php#94 - [x] CodeWithKyrian/platform-package-installer#3 - [x] CodeWithKyrian/platform-package-installer#4 Commits ------- b9dd575 Drop Symfony 6.4 support, require ^7.3|^8.0
2 parents 0b9d41c + b9dd575 commit 264b4e3

File tree

24 files changed

+125
-167
lines changed

24 files changed

+125
-167
lines changed

.github/workflows/integration-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
dependency-version: 'lowest'
3333
# LTS version of Symfony
3434
- php-version: '8.2'
35-
symfony-version: '6.4.*'
35+
symfony-version: '7.4.*'
3636

3737
env:
38-
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}
38+
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.3' }}
3939

4040
steps:
4141
- uses: actions/checkout@v5

.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.4'
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@v5

composer.json

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

examples/commands/stores.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@
116116
$application = new Application();
117117
$application->setAutoExit(false);
118118
$application->setCatchExceptions(false);
119-
$application->add(new SetupStoreCommand(new ServiceLocator($factories)));
120-
$application->add(new DropStoreCommand(new ServiceLocator($factories)));
119+
$application->addCommands([
120+
new SetupStoreCommand(new ServiceLocator($factories)),
121+
new DropStoreCommand(new ServiceLocator($factories)),
122+
]);
121123

122124
foreach ($storesIds as $store) {
123125
$setupOutputCode = $application->run(new ArrayInput([

examples/composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
"symfony/ai-agent": "@dev",
2020
"symfony/ai-platform": "@dev",
2121
"symfony/ai-store": "@dev",
22-
"symfony/cache": "^6.4 || ^7.0",
23-
"symfony/console": "^6.4 || ^7.0",
24-
"symfony/css-selector": "^6.4 || ^7.0",
25-
"symfony/dependency-injection": "^6.4 || ^7.0",
26-
"symfony/dom-crawler": "^6.4 || ^7.0",
27-
"symfony/dotenv": "^6.4 || ^7.0",
28-
"symfony/event-dispatcher": "^6.4 || ^7.0",
29-
"symfony/filesystem": "^6.4 || ^7.0",
30-
"symfony/finder": "^6.4 || ^7.0",
31-
"symfony/process": "^6.4 || ^7.0",
32-
"symfony/var-dumper": "^6.4 || ^7.0"
22+
"symfony/cache": "^7.3|^8.0",
23+
"symfony/console": "^7.3|^8.0",
24+
"symfony/css-selector": "^7.3|^8.0",
25+
"symfony/dependency-injection": "^7.3|^8.0",
26+
"symfony/dom-crawler": "^7.3|^8.0",
27+
"symfony/dotenv": "^7.3|^8.0",
28+
"symfony/event-dispatcher": "^7.3|^8.0",
29+
"symfony/filesystem": "^7.3|^8.0",
30+
"symfony/finder": "^7.3|^8.0",
31+
"symfony/process": "^7.3|^8.0",
32+
"symfony/var-dumper": "^7.3|^8.0"
3333
},
3434
"require-dev": {
3535
"phpstan/phpstan": "^2.1"

src/agent/composer.json

Lines changed: 13 additions & 12 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": "^0.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
"symfony/translation-contracts": "^3.6"
4646
},
4747
"autoload": {
@@ -64,5 +64,6 @@
6464
"name": "symfony/ai",
6565
"url": "https://github.com/symfony/ai"
6666
}
67-
}
67+
},
68+
"minimum-stability": "dev"
6869
}

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/FirecrawlTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class FirecrawlTest extends TestCase
2323
public function testScrape()
2424
{
2525
$httpClient = new MockHttpClient([
26-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-scrape.json'), true)),
26+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-scrape.json'),
2727
]);
2828

2929
$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
@@ -39,10 +39,10 @@ public function testScrape()
3939
public function testCrawl()
4040
{
4141
$httpClient = new MockHttpClient([
42-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-crawl-wait.json'), true)),
43-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-crawl-status.json'), true)),
44-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-crawl-status-done.json'), true)),
45-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-crawl.json'), true)),
42+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-wait.json'),
43+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-status.json'),
44+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl-status-done.json'),
45+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-crawl.json'),
4646
]);
4747

4848
$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');
@@ -62,7 +62,7 @@ public function testCrawl()
6262
public function testMap()
6363
{
6464
$httpClient = new MockHttpClient([
65-
new JsonMockResponse(json_decode(file_get_contents(__DIR__.'/fixtures/firecrawl-map.json'), true)),
65+
JsonMockResponse::fromFile(__DIR__.'/fixtures/firecrawl-map.json'),
6666
]);
6767

6868
$firecrawl = new Firecrawl($httpClient, 'test', 'https://127.0.0.1:3002');

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

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

2828
$mapbox = new Mapbox($httpClient, 'test_token');
@@ -48,7 +48,7 @@ public function testGeocodeWithSingleResult()
4848

4949
public function testGeocodeWithMultipleResults()
5050
{
51-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/mapbox-geocode-multiple.json');
51+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-geocode-multiple.json');
5252
$httpClient = new MockHttpClient($result);
5353

5454
$mapbox = new Mapbox($httpClient, 'test_token');
@@ -83,7 +83,7 @@ public function testGeocodeWithMultipleResults()
8383

8484
public function testGeocodeWithNoResults()
8585
{
86-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/mapbox-geocode-empty.json');
86+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-geocode-empty.json');
8787
$httpClient = new MockHttpClient($result);
8888

8989
$mapbox = new Mapbox($httpClient, 'test_token');
@@ -99,7 +99,7 @@ public function testGeocodeWithNoResults()
9999

100100
public function testReverseGeocodeWithValidCoordinates()
101101
{
102-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/mapbox-reverse-geocode.json');
102+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-reverse-geocode.json');
103103
$httpClient = new MockHttpClient($result);
104104

105105
$mapbox = new Mapbox($httpClient, 'test_token');
@@ -141,7 +141,7 @@ public function testReverseGeocodeWithValidCoordinates()
141141

142142
public function testReverseGeocodeWithNoResults()
143143
{
144-
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/mapbox-reverse-geocode-empty.json');
144+
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/mapbox-reverse-geocode-empty.json');
145145
$httpClient = new MockHttpClient($result);
146146

147147
$mapbox = new Mapbox($httpClient, 'test_token');
@@ -154,12 +154,4 @@ public function testReverseGeocodeWithNoResults()
154154

155155
$this->assertEquals($expected, $actual);
156156
}
157-
158-
/**
159-
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
160-
*/
161-
private function jsonMockResponseFromFile(string $file): JsonMockResponse
162-
{
163-
return new JsonMockResponse(json_decode(file_get_contents($file), true));
164-
}
165157
}

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
}

0 commit comments

Comments
 (0)