Skip to content

Drop Symfony 6.4 support, require ^7.3|^8.0 #277

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ jobs:
# lowest deps
- php-version: '8.2'
dependency-version: 'lowest'
# LTS version of Symfony
# Symfony 7.4 LTS
- php-version: '8.2'
symfony-version: '6.4.*'
symfony-version: '7.4.*'
# Symfony 8.0
- php-version: '8.3'
symfony-version: '8.0.*'

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

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"require-dev": {
"php": ">=8.2",
"php-cs-fixer/shim": "^3.75",
"symfony/finder": "^6.4 || ^7.0",
"symfony/filesystem": "^6.4 || ^7.0"
"symfony/finder": "^7.3|^8.0",
"symfony/filesystem": "^7.3|^8.0"
},
"config": {
"sort-packages": true
Expand Down
18 changes: 9 additions & 9 deletions examples/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"symfony/ai-agent": "@dev",
"symfony/ai-platform": "@dev",
"symfony/ai-store": "@dev",
"symfony/console": "^6.4|^7.0",
"symfony/css-selector": "^6.4|^7.0",
"symfony/dom-crawler": "^6.4|^7.0",
"symfony/dotenv": "^6.4|^7.0",
"symfony/event-dispatcher": "^6.4|^7.0",
"symfony/filesystem": "^6.4|^7.0",
"symfony/finder": "^6.4|^7.0",
"symfony/process": "^6.4|^7.0",
"symfony/var-dumper": "^6.4|^7.0"
"symfony/console": "^7.3|^8.0",
"symfony/css-selector": "^7.3|^8.0",
"symfony/dom-crawler": "^7.3|^8.0",
"symfony/dotenv": "^7.3|^8.0",
"symfony/event-dispatcher": "^7.3|^8.0",
"symfony/filesystem": "^7.3|^8.0",
"symfony/finder": "^7.3|^8.0",
"symfony/process": "^7.3|^8.0",
"symfony/var-dumper": "^7.3|^8.0"
},
"autoload": {
"psr-4": {
Expand Down
22 changes: 11 additions & 11 deletions src/agent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
"phpstan/phpdoc-parser": "^2.1",
"psr/log": "^3.0",
"symfony/ai-platform": "@dev",
"symfony/clock": "^6.4 || ^7.1",
"symfony/http-client": "^6.4 || ^7.1",
"symfony/property-access": "^6.4 || ^7.1",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.1",
"symfony/type-info": "^7.2.3"
"symfony/clock": "^7.3|^8.0",
"symfony/http-client": "^7.3|^8.0",
"symfony/property-access": "^7.3|^8.0",
"symfony/property-info": "^7.3|^8.0",
"symfony/serializer": "^7.3|^8.0",
"symfony/type-info": "^7.3|^8.0"
},
"require-dev": {
"mrmysql/youtube-transcript": "^v0.0.5",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.5.13",
"symfony/ai-store": "@dev",
"symfony/cache": "^6.4 || ^7.1",
"symfony/css-selector": "^6.4 || ^7.1",
"symfony/dom-crawler": "^6.4 || ^7.1",
"symfony/event-dispatcher": "^6.4 || ^7.1",
"symfony/http-foundation": "^6.4 || ^7.1"
"symfony/cache": "^7.3|^8.0",
"symfony/css-selector": "^7.3|^8.0",
"symfony/dom-crawler": "^7.3|^8.0",
"symfony/event-dispatcher": "^7.3|^8.0",
"symfony/http-foundation": "^7.3|^8.0"
},
"config": {
"sort-packages": true
Expand Down
12 changes: 2 additions & 10 deletions src/agent/tests/Toolbox/Tool/BraveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class BraveTest extends TestCase
{
public function testReturnsSearchResults()
{
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/brave.json');
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/brave.json');
$httpClient = new MockHttpClient($result);
$brave = new Brave($httpClient, 'test-api-key');

Expand All @@ -40,7 +40,7 @@ public function testReturnsSearchResults()

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

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

$this->assertEmpty($results);
}

/**
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
*/
private function jsonMockResponseFromFile(string $file): JsonMockResponse
{
return new JsonMockResponse(json_decode(file_get_contents($file), true));
}
}
12 changes: 2 additions & 10 deletions src/agent/tests/Toolbox/Tool/OpenMeteoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class OpenMeteoTest extends TestCase
{
public function testCurrent()
{
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/openmeteo-current.json');
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/openmeteo-current.json');
$httpClient = new MockHttpClient($result);

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

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

$openMeteo = new OpenMeteo($httpClient);
Expand Down Expand Up @@ -69,12 +69,4 @@ public function testForecast()

$this->assertSame($expected, $actual);
}

/**
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
*/
private function jsonMockResponseFromFile(string $file): JsonMockResponse
{
return new JsonMockResponse(json_decode(file_get_contents($file), true));
}
}
18 changes: 5 additions & 13 deletions src/agent/tests/Toolbox/Tool/WikipediaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class WikipediaTest extends TestCase
{
public function testSearchWithResults()
{
$result = $this->jsonMockResponseFromFile(__DIR__.'/fixtures/wikipedia-search-result.json');
$result = JsonMockResponse::fromFile(__DIR__.'/fixtures/wikipedia-search-result.json');
$httpClient = new MockHttpClient($result);

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

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

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

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

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

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

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

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

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

$this->assertSame($expected, $actual);
}

/**
* This can be replaced by `JsonMockResponse::fromFile` when dropping Symfony 6.4.
*/
private function jsonMockResponseFromFile(string $file): JsonMockResponse
{
return new JsonMockResponse(json_decode(file_get_contents($file), true));
}
}
12 changes: 6 additions & 6 deletions src/ai-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"symfony/ai-agent": "@dev",
"symfony/ai-platform": "@dev",
"symfony/ai-store": "@dev",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/string": "^6.4 || ^7.0"
"symfony/config": "^7.3|^8.0",
"symfony/dependency-injection": "^7.3|^8.0",
"symfony/framework-bundle": "^7.3|^8.0",
"symfony/string": "^7.3|^8.0"
},
"require-dev": {
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/security-core": "^6.4 || ^7.0"
"symfony/expression-language": "^7.3|^8.0",
"symfony/security-core": "^7.3|^8.0"
},
"config": {
"sort-packages": true
Expand Down
14 changes: 7 additions & 7 deletions src/mcp-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}
],
"require": {
"symfony/config": "^6.4 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/config": "^7.3|^8.0",
"symfony/console": "^7.3|^8.0",
"symfony/dependency-injection": "^7.3|^8.0",
"symfony/framework-bundle": "^7.3|^8.0",
"symfony/http-foundation": "^7.3|^8.0",
"symfony/http-kernel": "^7.3|^8.0",
"symfony/mcp-sdk": "@dev",
"symfony/routing": "^6.4 || ^7.0"
"symfony/routing": "^7.3|^8.0"
},
"require-dev": {
"phpstan/phpstan": "^2.1",
Expand Down
5 changes: 3 additions & 2 deletions src/mcp-sdk/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
"require": {
"php": "^8.2",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/uid": "^6.4 || ^7.0"
"symfony/uid": "^7.3|^8.0"
},
"require-dev": {
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.5",
"symfony/console": "^6.4 || ^7.0",
"symfony/console": "^7.3|^8.0",
"rector/rector": "^2.0",
"psr/cache": "^3.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-sdk/examples/cli/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"php": ">=8.2",
"symfony/mcp-sdk": "@dev",
"symfony/console": "^7.2"
"symfony/console": "^7.3|^8.0"
},
"minimum-stability": "stable",
"autoload": {
Expand Down
26 changes: 13 additions & 13 deletions src/platform/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@
"phpdocumentor/reflection-docblock": "^5.4",
"phpstan/phpdoc-parser": "^2.1",
"psr/log": "^3.0",
"symfony/clock": "^6.4 || ^7.1",
"symfony/http-client": "^6.4 || ^7.1",
"symfony/property-access": "^6.4 || ^7.1",
"symfony/property-info": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.1",
"symfony/type-info": "^7.2.3",
"symfony/uid": "^6.4 || ^7.1"
"symfony/clock": "^7.3|^8.0",
"symfony/http-client": "^7.3|^8.0",
"symfony/property-access": "^7.3|^8.0",
"symfony/property-info": "^7.3|^8.0",
"symfony/serializer": "^7.3|^8.0",
"symfony/type-info": "^7.3|^8.0",
"symfony/uid": "^7.3|^8.0"
},
"require-dev": {
"async-aws/bedrock-runtime": "^0.1.0",
"codewithkyrian/transformers": "^0.5.3",
"phpstan/phpstan": "^2.1.17",
"phpstan/phpstan-symfony": "^2.0.6",
"phpunit/phpunit": "^11.5",
"symfony/console": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/console": "^7.3|^8.0",
"symfony/dotenv": "^7.3|^8.0",
"symfony/ai-agent": "@dev",
"symfony/event-dispatcher": "^6.4 || ^7.1",
"symfony/finder": "^6.4 || ^7.1",
"symfony/process": "^6.4 || ^7.1",
"symfony/var-dumper": "^6.4 || ^7.1"
"symfony/event-dispatcher": "^7.3|^8.0",
"symfony/finder": "^7.3|^8.0",
"symfony/process": "^7.3|^8.0",
"symfony/var-dumper": "^7.3|^8.0"
},
"config": {
"allow-plugins": {
Expand Down
8 changes: 1 addition & 7 deletions src/platform/src/Bridge/Anthropic/ResultConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Symfony\AI\Platform\ResultConverterInterface;
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
use Symfony\Component\HttpClient\EventSourceHttpClient;
use Symfony\Component\HttpClient\Exception\JsonException;
use Symfony\Contracts\HttpClient\ResponseInterface as HttpResponse;

/**
Expand Down Expand Up @@ -73,12 +72,7 @@ private function convertStream(HttpResponse $result): \Generator
continue;
}

try {
$data = $chunk->getArrayData();
} catch (JsonException) {
// try catch only needed for Symfony 6.4
continue;
}
$data = $chunk->getArrayData();

if ('content_block_delta' != $data['type'] || !isset($data['delta']['text'])) {
continue;
Expand Down
8 changes: 1 addition & 7 deletions src/platform/src/Bridge/Mistral/Llm/ResultConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Symfony\AI\Platform\ResultConverterInterface;
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
use Symfony\Component\HttpClient\EventSourceHttpClient;
use Symfony\Component\HttpClient\Exception\JsonException;
use Symfony\Contracts\HttpClient\ResponseInterface as HttpResponse;

/**
Expand Down Expand Up @@ -72,12 +71,7 @@ private function convertStream(HttpResponse $result): \Generator
continue;
}

try {
$data = $chunk->getArrayData();
} catch (JsonException) {
// try catch only needed for Symfony 6.4
continue;
}
$data = $chunk->getArrayData();

if ($this->streamIsToolCall($data)) {
$toolCalls = $this->convertStreamToToolCalls($toolCalls, $data);
Expand Down
8 changes: 1 addition & 7 deletions src/platform/src/Bridge/OpenAi/Gpt/ResultConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Symfony\AI\Platform\ResultConverterInterface as PlatformResponseConverter;
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
use Symfony\Component\HttpClient\EventSourceHttpClient;
use Symfony\Component\HttpClient\Exception\JsonException;
use Symfony\Contracts\HttpClient\ResponseInterface as HttpResponse;

/**
Expand Down Expand Up @@ -69,12 +68,7 @@ private function convertStream(HttpResponse $result): \Generator
continue;
}

try {
$data = $chunk->getArrayData();
} catch (JsonException) {
// try catch only needed for Symfony 6.4
continue;
}
$data = $chunk->getArrayData();

if ($this->streamIsToolCall($data)) {
$toolCalls = $this->convertStreamToToolCalls($toolCalls, $data);
Expand Down
6 changes: 3 additions & 3 deletions src/store/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"ext-fileinfo": "*",
"psr/log": "^3.0",
"symfony/ai-platform": "@dev",
"symfony/clock": "^6.4 || ^7.1",
"symfony/http-client": "^6.4 || ^7.1",
"symfony/uid": "^6.4 || ^7.1"
"symfony/clock": "^7.3|^8.0",
"symfony/http-client": "^7.3|^8.0",
"symfony/uid": "^7.3|^8.0"
},
"require-dev": {
"codewithkyrian/chromadb-php": "^0.2.1 || ^0.3 || ^0.4",
Expand Down
Loading