diff --git a/src/Blog/Embedder.php b/src/Blog/Embedder.php new file mode 100644 index 0000000..8cb8eec --- /dev/null +++ b/src/Blog/Embedder.php @@ -0,0 +1,60 @@ +loader->load(); + $vectors = $this->createEmbeddings($posts); + $this->pushToChromaDB($posts, $vectors); + } + + /** + * @param Post[] $posts + * + * @return Vector[] + */ + private function createEmbeddings(array $posts): array + { + $texts = array_map(fn (Post $post) => $post->toString(), $posts); + $response = $this->platform->request(new Embeddings(), $texts); + + assert($response instanceof AsyncResponse); + $response = $response->unwrap(); + assert($response instanceof VectorResponse); + + return $response->getContent(); + } + + /** + * @param Post[] $posts + * @param Vector[] $vectors + */ + private function pushToChromaDB(array $posts, array $vectors): void + { + $collection = $this->chromaClient->getOrCreateCollection('symfony_blog'); + + $ids = array_map(fn (Post $post) => $post->id, $posts); + $vectors = array_map(fn (Vector $vector) => $vector->getData(), $vectors); + + $collection->upsert($ids, $vectors, $posts); + } +} diff --git a/src/Blog/Loader.php b/src/Blog/Loader.php new file mode 100644 index 0000000..866e7cc --- /dev/null +++ b/src/Blog/Loader.php @@ -0,0 +1,42 @@ +httpClient->request('GET', 'https://feeds.feedburner.com/symfony/blog'); + + $posts = []; + $crawler = new Crawler($response->getContent()); + $crawler->filter('item')->each(function (Crawler $node) use (&$posts) { + $title = $node->filter('title')->text(); + $posts[] = new Post( + Uuid::v5(Uuid::fromString('6ba7b810-9dad-11d1-80b4-00c04fd430c8'), $title), + $title, + $node->filter('link')->text(), + $node->filter('description')->text(), + (new Crawler($node->filter('content\:encoded')->text()))->text(), + $node->filter('dc\:creator')->text(), + new \DateTimeImmutable($node->filter('pubDate')->text()), + ); + }); + + return $posts; + } +} diff --git a/src/Blog/Post.php b/src/Blog/Post.php new file mode 100644 index 0000000..6aff1ac --- /dev/null +++ b/src/Blog/Post.php @@ -0,0 +1,55 @@ +title} + From: {$this->author} on {$this->date->format('Y-m-d')} + Description: {$this->description} + {$this->content} + TEXT; + } + + /** + * @return array{ + * id: string, + * title: string, + * link: string, + * description: string, + * content: string, + * author: string, + * date: string, + * } + */ + public function toArray(): array + { + return [ + 'id' => $this->id->toRfc4122(), + 'title' => $this->title, + 'link' => $this->link, + 'description' => $this->description, + 'content' => $this->content, + 'author' => $this->author, + 'date' => $this->date->format('Y-m-d'), + ]; + } +} diff --git a/src/Command/BlogEmbedCommand.php b/src/Command/BlogEmbedCommand.php index ea5436e..27affd9 100644 --- a/src/Command/BlogEmbedCommand.php +++ b/src/Command/BlogEmbedCommand.php @@ -4,39 +4,18 @@ namespace App\Command; -use Codewithkyrian\ChromaDB\Client; -use PhpLlm\LlmChain\Bridge\OpenAI\Embeddings; -use PhpLlm\LlmChain\Document\Vector; -use PhpLlm\LlmChain\Model\Response\AsyncResponse; -use PhpLlm\LlmChain\Model\Response\VectorResponse; -use PhpLlm\LlmChain\PlatformInterface; +use App\Blog\Embedder; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\Uid\Uuid; -use Symfony\Contracts\HttpClient\HttpClientInterface; -/** - * @phpstan-type Post array{ - * id: Uuid, - * title: string, - * link: string, - * description: string, - * content: string, - * author: string, - * date: \DateTimeImmutable, - * } - */ #[AsCommand('app:blog:embed', description: 'Create embeddings for Symfony blog and push to ChromaDB.')] final class BlogEmbedCommand extends Command { public function __construct( - private readonly HttpClientInterface $httpClient, - private readonly PlatformInterface $platform, - private readonly Client $chromaClient, + private readonly Embedder $embedder, ) { parent::__construct(); } @@ -46,85 +25,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io = new SymfonyStyle($input, $output); $io->title('Loading RSS of Symfony blog as embeddings into ChromaDB'); - $posts = $this->loadBlogPosts(); - $vectors = $this->createEmbeddings($posts); - $this->pushToChromaDB($posts, $vectors); + $this->embedder->embedBlog(); $io->success('Symfony Blog Successfully Embedded!'); return Command::SUCCESS; } - - /** - * @return list - */ - private function loadBlogPosts(): array - { - $response = $this->httpClient->request('GET', 'https://feeds.feedburner.com/symfony/blog'); - - $posts = []; - $crawler = new Crawler($response->getContent()); - $crawler->filter('item')->each(function (Crawler $node) use (&$posts) { - $title = $node->filter('title')->text(); - $posts[] = [ - 'id' => Uuid::v5(Uuid::fromString('6ba7b810-9dad-11d1-80b4-00c04fd430c8'), $title), - 'title' => $title, - 'link' => $node->filter('link')->text(), - 'description' => $node->filter('description')->text(), - 'content' => (new Crawler($node->filter('content\:encoded')->text()))->text(), - 'author' => $node->filter('dc\:creator')->text(), - 'date' => new \DateTimeImmutable($node->filter('pubDate')->text()), - ]; - }); - - return $posts; - } - - /** - * @param Post[] $posts - * - * @return Vector[] - */ - private function createEmbeddings(array $posts): array - { - $texts = []; - foreach ($posts as $post) { - $texts[] = <<format('Y-m-d')} - Description: {$post['description']} - {$post['content']} - TEXT; - } - - $response = $this->platform->request(new Embeddings(), $texts); - - assert($response instanceof AsyncResponse); - $response = $response->unwrap(); - assert($response instanceof VectorResponse); - - return $response->getContent(); - } - - /** - * @param Post[] $posts - * @param Vector[] $vectors - */ - private function pushToChromaDB(array $posts, array $vectors): void - { - $collection = $this->chromaClient->getOrCreateCollection('symfony_blog'); - - $ids = array_column($posts, 'id'); - $vectors = array_map(fn (Vector $vector) => $vector->getData(), $vectors); - - $collection->upsert($ids, $vectors, $posts); - } } diff --git a/tests/Blog/EmbedderTest.php b/tests/Blog/EmbedderTest.php new file mode 100644 index 0000000..51652be --- /dev/null +++ b/tests/Blog/EmbedderTest.php @@ -0,0 +1,101 @@ +createMock(PlatformInterface::class); + $chromaClient = $this->createMock(Client::class); + $posts = $loader->load(); + $vectors = [ + new Vector([0.1, 0.2, 0.3]), + new Vector([0.4, 0.5, 0.6]), + new Vector([0.7, 0.8, 0.9]), + new Vector([1.0, 1.1, 1.2]), + new Vector([1.3, 1.4, 1.5]), + new Vector([1.6, 1.7, 1.8]), + new Vector([1.9, 2.0, 2.1]), + new Vector([2.2, 2.3, 2.4]), + new Vector([2.5, 2.6, 2.7]), + new Vector([2.8, 2.9, 3.0]), + ]; + $platform + ->method('request') + ->willReturn($this->createAsyncResponse($vectors)); + + $collection = $this->createMock(CollectionResource::class); + $chromaClient + ->expects($this->once()) + ->method('getOrCreateCollection') + ->with('symfony_blog') + ->willReturn($collection); + + $collection + ->expects($this->once()) + ->method('upsert') + ->with( + array_map(fn (Post $post) => $post->id, $posts), + array_map(fn (Vector $vector) => $vector->getData(), $vectors), + $posts, + ); + + $embedder = new Embedder($loader, $platform, $chromaClient); + $embedder->embedBlog(); + } + + /** + * @param Vector[] $vectors + */ + private function createAsyncResponse(array $vectors): AsyncResponse + { + $converter = new class($vectors) implements ResponseConverter { + /** + * @param Vector[] $vectors + */ + public function __construct(private readonly array $vectors) + { + } + + public function supports(Model $model, object|array|string $input): bool + { + return true; + } + + public function convert(HttpResponse $response, array $options = []): LlmResponse + { + return new VectorResponse(...$this->vectors); + } + }; + + return new AsyncResponse($converter, new MockResponse()); + } +} diff --git a/tests/Blog/LoaderTest.php b/tests/Blog/LoaderTest.php new file mode 100644 index 0000000..31f42f0 --- /dev/null +++ b/tests/Blog/LoaderTest.php @@ -0,0 +1,46 @@ +load(); + + self::assertCount(10, $posts); + + self::assertSame('A Week of Symfony #936 (2-8 December 2024)', $posts[0]->title); + self::assertSame('https://symfony.com/blog/a-week-of-symfony-936-2-8-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed', $posts[0]->link); + self::assertStringContainsString('This week, Symfony celebrated the SymfonyCon 2024 Vienna conference with great success.', $posts[0]->description); + self::assertStringContainsString('Select a track for a guided path through 100+ video tutorial courses about Symfony', $posts[0]->content); + self::assertSame('Javier Eguiluz', $posts[0]->author); + self::assertEquals(new \DateTimeImmutable('8.12.2024 09:39:00 +0100'), $posts[0]->date); + + self::assertSame('A Week of Symfony #935 (25 November - 1 December 2024)', $posts[1]->title); + self::assertSame('Symfony 7.2 curated new features', $posts[2]->title); + self::assertSame('Symfony 7.2.0 released', $posts[3]->title); + self::assertSame('Symfony 5.4.49 released', $posts[4]->title); + self::assertSame('SymfonyCon Vienna 2024: See you next week!', $posts[5]->title); + self::assertSame('New in Symfony 7.2: Misc. Improvements (Part 2)', $posts[6]->title); + self::assertSame('Symfony 7.1.9 released', $posts[7]->title); + self::assertSame('Symfony 6.4.16 released', $posts[8]->title); + self::assertSame('Symfony 5.4.48 released', $posts[9]->title); + } +} diff --git a/tests/Blog/PostTest.php b/tests/Blog/PostTest.php new file mode 100644 index 0000000..866f3f2 --- /dev/null +++ b/tests/Blog/PostTest.php @@ -0,0 +1,62 @@ +toString()); + } + + public function testPostToArray(): void + { + $id = Uuid::v4(); + $post = new Post( + $id, + 'Hello, World!', + 'https://example.com/hello-world', + 'This is a test description.', + 'This is a test post.', + 'John Doe', + new \DateTimeImmutable('2024-12-08 09:39:00'), + ); + + $expected = [ + 'id' => $id->toRfc4122(), + 'title' => 'Hello, World!', + 'link' => 'https://example.com/hello-world', + 'description' => 'This is a test description.', + 'content' => 'This is a test post.', + 'author' => 'John Doe', + 'date' => '2024-12-08', + ]; + + self::assertSame($expected, $post->toArray()); + } +} diff --git a/tests/Blog/fixtures/blog.rss b/tests/Blog/fixtures/blog.rss new file mode 100644 index 0000000..9fc7c51 --- /dev/null +++ b/tests/Blog/fixtures/blog.rss @@ -0,0 +1,996 @@ + + + + Symfony Blog + + https://symfony.com/blog/ + Most recent posts published on the Symfony project blog + Tue, 10 Dec 2024 23:56:55 +0100 + Sun, 08 Dec 2024 09:39:00 +0100 + en + + <![CDATA[A Week of Symfony #936 (2-8 December 2024)]]> + https://symfony.com/blog/a-week-of-symfony-936-2-8-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + This week, Symfony celebrated the SymfonyCon 2024 Vienna conference with great success. This annual event brought together the global Symfony community to exchange ideas, learn new things, and collaborate on contributions to the Symfony project. In addition,… + This week, Symfony celebrated the SymfonyCon 2024 Vienna conference with great success. This annual event brought together the global Symfony community to exchange ideas, learn new things, and collaborate on contributions to the Symfony project. In addition, the upcoming Symfony 7.3 version introduced support for pre-compressing web assets and a new userIsGranted() security method to test user authorization without relying on the session.

+ +

Symfony development highlights

+ +

This week, 57 pull requests were merged (28 in code and 29 in docs) and 28 issues were closed (22 in code and 6 in docs). Excluding merges, 35 authors made 2,784 additions and 954 deletions. See details for code and docs.

+ +

6.4 changelog:

+ +
    +
  • 8c8bab2: [TwigBridge] fix Twig 3.17 compatibility
  • +
  • ffc4dc6: [HttpClient] always set CURLOPT_CUSTOMREQUEST to the correct HTTP method in CurlHttpClient
  • +
  • 74e9163: [PropertyInfo] evaluate access flags for properties with asymmetric visibility
  • +
  • 51d824a: [Console] fix division by 0 error
  • +
  • caa1be7: [ErrorHandler] fix error message in test with PHP 8.5
  • +
  • e25242a: [TwigBridge] add tests covering trans_default_domain with dynamic expressions
  • +
  • 91835ef: [FrameworkBundle] fix notifier push channel bus abstract arg
  • +
+ +

7.1 changelog:

+ +
    +
  • 2d9f2a5: [Scheduler] remove unused code
  • +
+ +

7.2 changelog:

+ +
    +
  • cc1802d: [TwigBridge] generate conflict-free variable names
  • +
  • 6076b87, dcf824a: [Mailer] fix null check on region in Sendgrid mailer
  • +
  • f24ac9e: [FrameworkBundle] make uri_signer lazy and improve error when kernel.secret is empty
  • +
  • 27c0f65: [Notifier] fix desktop channel bus abstract arg
  • +
+ +

7.3 changelog:

+ +
    +
  • 2d1838a: [VarDumper] add caster for Socket instances
  • +
  • 3a804f5: [Mailer, Notifier] add webhooks signature verification on Sweego bridges
  • +
  • 12e4e53: [AssetMapper] add support for assets pre-compression
  • +
  • b6d6adf: [FrameworkBundle] rename TranslationUpdateCommand to TranslationExtract command to match the command name
  • +
  • b7ed0a4: [ErrorHandler] support non-empty-string/non-empty-list when patching return types
  • +
  • 12ff1bf: [Uid] add @return non-empty-string annotations to AbstractUid and relevant functions
  • +
  • 4612ff2: [Security, SecurityBundle] add a userIsGranted() method to test user authorization without relying on the session
  • +
+ +

Newest issues and pull requests

+ + + +

Symfony Jobs

+ +

These are some of the most recent Symfony job offers:

+ +
    +
  • Symfony Developer at Adria Solutions
    +Full-time - £45,000 – £60,000 / year
    +Remote + part-time onsite (Cardiff, United Kingdom)
    +View details
  • +
  • Backend Symfony Developer at Bold Company
    +Full-time - €4,200 / month
    +Remote + part-time onsite (Rotterdam, Netherlands)
    +View details
  • +
  • Symfony Developer at Kennisnet
    +Full-time - €4,104 – €5,673 / month
    +Remote + part-time onsite (Zoetermeer, Netherlands)
    +View details
  • +
+ +

You can publish a Symfony job offer for free on symfony.com.

+ +

SymfonyCasts Updates

+ +

SymfonyCasts is the official way to learn Symfony. +Select a track for a guided path through 100+ video tutorial courses about +Symfony, PHP and JavaScript.

+ +

This week, SymfonyCasts published the following updates:

+ + + +

They talked about us

+ + + +

Call to Action

+ + + +
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/a-week-of-symfony-936-2-8-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Sun, 08 Dec 2024 09:39:00 +0100 + https://symfony.com/blog/a-week-of-symfony-936-2-8-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[A Week of Symfony #935 (25 November - 1 December 2024)]]> + https://symfony.com/blog/a-week-of-symfony-935-25-november-1-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + This week, the stable Symfony 7.2.0 version was released, featuring tens of new additions. Additionally, we announced the Black Friday Symfony promotions. Furthermore, the maintenance releases for Symfony 5.4.48, 6.4.16, and 7.1.9 are now available. Finally,… + This week, the stable Symfony 7.2.0 version was released, featuring tens of new additions. Additionally, we announced the Black Friday Symfony promotions. Furthermore, the maintenance releases for Symfony 5.4.48, 6.4.16, and 7.1.9 are now available. Finally, next week, the global Symfony community will gather in Vienna for the SymfonyCon 2024 conference.

+ +

Symfony development highlights

+ +

This week, 39 pull requests were merged (28 in code and 11 in docs) and 21 issues were closed (19 in code and 2 in docs). Excluding merges, 21 authors made 1,033 additions and 332 deletions. See details for code and docs.

+ +

5.4 changelog:

+ +
    +
  • 5cbdb87: [HttpClient] various cleanups after recent changes
  • +
  • 520e31b: [PropertyInfo] consider write property visibility to decide whether a property is writable
  • +
  • 294a39f: [Translation] fix empty keys array in PUT, DELETE requests causing Lokalise API error
  • +
  • ec691c8: [PropertyInfo] fix write visibility for Asymmetric Visibility and Virtual Properties
  • +
  • 1b7d8b3: [Dotenv] read runtime config from composer.json in debug dotenv command
  • +
  • 9eea677: [HttpClient] close gracefull when the server closes the connection abruptly
  • +
  • 4677f32: [HttpClient] fix checking for private IPs before connecting
  • +
  • 7a2d66a: [HttpClient] fix streaming and redirecting with NoPrivateNetworkHttpClient
  • +
+ +

6.4 changelog:

+ +
    +
  • 76df983: [DoctrineBridge] fix Connection::createSchemaManager() for Doctrine DBAL v2
  • +
  • 9c6b5d5: [HttpClient] more consistency cleanups
  • +
  • a59ff05: [Messenger] fix Envelope::all() conditional return docblock
  • +
+ +

7.2 changelog:

+ +
    +
  • e128d76: [HttpClient] fix amphp/http-client 5 support
  • +
  • 59ceb58: [Form] allow integer for the calendar option of DateType
  • +
+ +

7.3 changelog:

+ +
    +
  • baf98b9: [VarDumper] add caster for AddressInfo objects
  • +
+ +

Newest issues and pull requests

+ + + +

Symfony CLI

+ +

Symfony CLI is a must-have tool when developing +Symfony applications on your local machine. It includes the +Symfony Local Server, +the best way to run local Symfony applications. This week Symfony CLI released +its new 5.10.5, +version with the following changes:

+ +
    +
  • Update fixtures (@fabpot)
  • +
  • Update check-requirements.php script to v2.0.3 (@fabpot)
  • +
  • Fix path on local envs (@fabpot)
  • +
  • Add a warning about the listening IP change in 5.10.3 (@tucksaun)
  • +
+ +

Symfony Jobs

+ +

These are some of the most recent Symfony job offers:

+ +
    +
  • Symfony Developer at Tactiplan
    +Full-time - €4,500 – €8,000 / month
    +Full remote
    +View details
  • +
  • Backend Symfony Developer at 2beGROUP
    +Full-time - €48,000 – €72,000 / year
    +Remote + part-time onsite (Leiderdorp, Netherlands)
    +View details
  • +
  • Symfony Developer at ProcurePro
    +Full-time - A$120,000 – A$150,000 / year
    +Full remote
    +View details
  • +
+ +

You can publish a Symfony job offer for free on symfony.com.

+ +

SymfonyCasts Updates

+ +

SymfonyCasts is the official way to learn Symfony. +Select a track for a guided path through 100+ video tutorial courses about +Symfony, PHP and JavaScript.

+ +

This week, SymfonyCasts published the following updates:

+ + + +

They talked about us

+ + + +

Call to Action

+ + + +
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/a-week-of-symfony-935-25-november-1-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Sun, 01 Dec 2024 09:54:00 +0100 + https://symfony.com/blog/a-week-of-symfony-935-25-november-1-december-2024?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 7.2 curated new features]]> + https://symfony.com/blog/symfony-7-2-curated-new-features?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 7.2.0 has been released. As for any other Symfony release, our backward compatibility promise applies and this means that you should be able to upgrade easily to 7.2 without changing anything in your code. + +During the last couple of months, we've… + Symfony 7.2.0 has been released. As for any other Symfony release, our backward compatibility promise applies and this means that you should be able to upgrade easily to 7.2 without changing anything in your code.

+ +

During the last couple of months, we've blogged about the great 7.2 new features. I highly recommend you to read these articles about Symfony 7.2 as they contain the major changes for this new version:

+ +
    +
  • Week, WordCount and Yaml Constraints: Symfony 7.2 introduces three new constraints: one to validate week numbers, another to check word count, and a third to validate YAML syntax.
  • +
  • Silent Verbosity: Symfony 7.2 introduces a new silent verbosity to supress all output, including errors.
  • +
  • Expression Language Improvements: Symfony 7.2 improves the ExpressionLanguage component with new bitwise and logical operators, easier registration of custom providers and support for comments.
  • +
  • AsMessage Attribute: Symfony 7.2 introduces a new AsMessage attribute, allowing you to configure the transport(s) directly within the message class
  • +
  • Named Serializers: Symfony 7.2 allows you to configure multiple serializer instances with different default contexts, name converters, and sets of normalizers and encoders.
  • +
  • Translations Linter: Symfony 7.2 includes a new lint:translations command to check the validity of your translation contents.
  • +
  • WhenNot Attribute: Symfony 7.2 introduces the WhenNot attribute to exclude a service from certain environments.
  • +
  • Lazy Choice Loader: Symfony 7.2 introduces a new lazy choice loader to improve performance of choice fields with lots of options.
  • +
  • String Component Improvements: Symfony 7.2 improves the String component with a new kebab-case method, new truncation modes and a Spanish inflector.
  • +
  • Compound Constraint Improvements: In Symfony 7.2, Compound constraints are easier to test and can define the validation groups and payload via the constructor.
  • +
  • Mailer and Notifier Integrations: Symfony 7.2 adds some new integrations to the Mailer and Notifier components, adding to the tens of integrations already available.
  • +
  • Improved Translation Extractor: Symfony 7.2 improves the translation extractor command, allowing customization of prefixes, modification of update behavior, and sorting of content.
  • +
  • Desktop Notifications: Symfony 7.2 allows to send notifications directly to your local desktop using the new desktop channel in the Notifier component.
  • +
  • Template DX Improvements: In Symfony 7.2, you can set HTTP headers in static pages and render specific Twig blocks using attributes.
  • +
  • Non-Empty Container Parameters: Symfony 7.2 introduces a new utility to require that some parameters exist and have non-empty values.
  • +
  • Keepalive Messenger Transports: Symfony 7.2 introduces the keepalive feature for Messenger transports, preventing timeouts when processing messages.
  • +
  • Mime Improvements: In Symfony 7.2, the Mime component adds support for custom encoders and Unicode email addresses.
  • +
  • Console Finished Indicator: Symfony 7.2 allows customizing the indicator displayed when a Console command completes.
  • +
  • Constraint Improvements: Symfony 7.2 adds a validation mode for BIC constraint, an errorPath for Unique constraint, format options for Ulid constraint, and context support for When constraint.
  • +
  • Simpler Trusted Proxies Configuration: Symfony 7.2 simplifies trusted proxy configuration with a private subnet shortcut and new environment variables.
  • +
  • Simpler Single-File Symfony Applications: In Symfony 7.2, single-file applications are now simpler and require less configuration.
  • +
  • New Command Options: Symfony 7.2 introduces new command options to lint container env vars, format messenger stats output, and filter assets during debugging.
  • +
  • Redesigned TypeInfo Component: Symfony 7.2 redesigns the TypeInfo component and makes it stable.
  • +
  • Serializer Improvements: Symfony 7.2 enhances the Serializer with support for DateTime subclasses, a new SnakeCaseToCamelCase name converter, updated UUID constants, and optional Webhook integration.
  • +
  • Stateless CSRF: Symfony 7.2 introduces stateless CSRF protection, enabling secure token validation without relying on server-side sessions.
  • +
  • Deprecations: Symfony 7.2 deprecates several features, including session config options, empty user identifiers, and the !tagged tag.
  • +
  • Optional Secret: Symfony 7.2 simplifies application setup by making the secret optional, enhancing security and developer experience.
  • +
  • Misc. Improvements (Part 1): Symfony 7.2 introduces features like custom retry delays for Messenger, improved null-coalesce support in expressions, custom attributes for user login passports, and enhanced VarDumper support for PHP 8.4 property hooks.
  • +
  • Misc. Improvements (Part 2): Symfony 7.2 adds password strength estimation, simpler RequestStack testing, nullable boolean configuration, improved IP anonymization, and Security Profiler upgrades.
  • +
+ +
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-7-2-curated-new-features?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Fri, 29 Nov 2024 09:52:00 +0100 + https://symfony.com/blog/symfony-7-2-curated-new-features?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 7.2.0 released]]> + https://symfony.com/blog/symfony-7-2-0-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 7.2.0 has just been released. +Check the Living on the Edge +category on this blog to learn about the main features of this new stable release; +or check the release announcement of BETA1 +to get the list of all new features. +Here is the list of the most… + Symfony 7.2.0 has just been released.

+

Check the Living on the Edge +category on this blog to learn about the main features of this new stable release; +or check the release announcement of BETA1 +to get the list of all new features.

+

Here is the list of the most important changes since 7.2.0-RC1:

+
    +
  • bug #59023 [HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient (@nicolas-grekas)
  • +
  • bug #59014 [Form] Allow integer for the calendar option of DateType (@alexandre-daubois)
  • +
  • bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas)
  • +
  • bug #58562 [HttpClient] Close gracefull when the server closes the connection abruptly (@discordier)
  • +
  • bug #59007 [Dotenv] read runtime config from composer.json in debug dotenv command (@xabbuh)
  • +
  • bug #58963 [PropertyInfo] Fix write visibility for Asymmetric Visibility and Virtual Properties (@xabbuh, @pan93412)
  • +
  • bug #58983 [Translation] [Bridge][Lokalise] Fix empty keys array in PUT, DELETE requests causing Lokalise API error (@DominicLuidold)
  • +
  • bug #58956 [DoctrineBridge] Fix Connection::createSchemaManager() for Doctrine DBAL v2 (@neodevcode)
  • +
  • bug #58959 [PropertyInfo] consider write property visibility to decide whether a property is writable (@xabbuh)
  • +
  • bug #58964 [TwigBridge] do not add child nodes to EmptyNode instances (@xabbuh)
  • +
  • bug #58950 [FrameworkBundle] Revert " Deprecate making cache.app adapter taggable" (@keulinho)
  • +
  • bug #58952 [Cache] silence warnings issued by Redis Sentinel on connection issues (@xabbuh)
  • +
  • bug #58953 [HttpClient] Fix computing stats for PUSH with Amp (@nicolas-grekas)
  • +
  • bug #58943 [FrameworkBundle] Revert " Don't auto-register form/csrf when the corresponding components are not installed" (@nicolas-grekas)
  • +
  • bug #58937 [FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed (@nicolas-grekas)
  • +
  • bug #58859 [AssetMapper] ignore missing directory in isVendor() (@alexislefebvre)
  • +
  • bug #58917 [OptionsResolver] Allow Union/Intersection Types in Resolved Closures (@zanbaldwin)
  • +
  • bug #58822 [DependencyInjection] Fix checking for interfaces in ContainerBuilder::getReflectionClass() (@donquixote)
  • +
  • bug #58865 Dynamically fix compatibility with doctrine/data-fixtures v2 (@greg0ire)
  • +
  • bug #58921 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception (@lyrixx)
  • +
  • bug #58908 [DoctrineBridge] don't call EntityManager::initializeObject() with scalar values (@xabbuh)
  • +
  • bug #58938 [Cache] make RelayProxyTrait compatible with relay extension 0.9.0 (@xabbuh)
  • +
  • bug #58924 [HttpClient] Fix empty hosts in option "resolve" (@nicolas-grekas)
  • +
  • bug #58915 [HttpClient] Fix option "resolve" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58919 [WebProfilerBundle] Twig deprecations (@mazodude)
  • +
  • bug #58914 [HttpClient] Fix option "bindto" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58888 [Mailer][Notifier] Sweego is backing their bridges, thanks to them! (@nicolas-grekas)
  • +
  • bug #58885 [PropertyInfo][Serializer][TypeInfo][Validator] TypeInfo 7.1 compatibility (@mtarld)
  • +
  • bug #58870 [Serializer][Validator] prevent failures around not existing TypeInfo classes (@xabbuh)
  • +
  • bug #58872 [PropertyInfo][Serializer][Validator] TypeInfo 7.2 compatibility (@mtarld)
  • +
  • bug #58875 [HttpClient] Removed body size limit (Carl Julian Sauter)
  • +
  • bug #58866 [Validator] fix compatibility with PHP < 8.2.4 (@xabbuh)
  • +
  • bug #58862 [Notifier] Fix GoIpTransport (@nicolas-grekas)
  • +
  • bug #58860 [HttpClient] Fix catching some invalid Location headers (@nicolas-grekas)
  • +
  • bug #58834 [FrameworkBundle] ensure validator.translation_domain parameter is always set (@xabbuh)
  • +
  • bug #58836 Work around parse_url() bug (bis) (@nicolas-grekas)
  • +
  • bug #58818 [Messenger] silence PHP warnings issued by Redis::connect() (@xabbuh)
  • +
  • bug #58828 [PhpUnitBridge] fix dumping tests to skip with data providers (@xabbuh)
  • +
  • bug #58842 [Routing] Fix: lost priority when defining hosts in configuration (@BeBlood)
  • +
  • bug #58850 [HttpClient] fix PHP 7.2 compatibility (@xabbuh)
  • +
+

Want to upgrade to this new release? Because Symfony protects +backwards-compatibility very closely, this should be quite easy. Use +SymfonyInsight upgrade reports +to detect the code you will need to change in your project and +read our upgrade +documentation to learn more.

+

Want to be notified whenever a new Symfony release is published? Or when a +version is not maintained anymore? Or only when a security issue is fixed? +Consider subscribing to the Symfony Roadmap Notifications.

+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-7-2-0-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Fri, 29 Nov 2024 09:46:04 +0100 + https://symfony.com/blog/symfony-7-2-0-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 5.4.49 released]]> + https://symfony.com/blog/symfony-5-4-49-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 5.4.49 has just been released. +Here is the list of the most important changes since 5.4.48: + + bug #59023 [HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient (@nicolas-grekas) + +WARNING: 5.4.49 is the last version for the Symfony… + Symfony 5.4.49 has just been released. +Here is the list of the most important changes since 5.4.48:

+
    +
  • bug #59023 [HttpClient] Fix streaming and redirecting with NoPrivateNetworkHttpClient (@nicolas-grekas)
  • +
+

WARNING: 5.4.49 is the last version for the Symfony 5.4 branch. If some +of your projects are still using this version, consider upgrading as soon as +possible. However, if you can't upgrade soon, note that we still provide +security issue releases according to our release policy.

+

Want to upgrade to this new release? Because Symfony protects +backwards-compatibility very closely, this should be quite easy. Use +SymfonyInsight upgrade reports +to detect the code you will need to change in your project and +read our upgrade +documentation to learn more.

+

Want to be notified whenever a new Symfony release is published? Or when a +version is not maintained anymore? Or only when a security issue is fixed? +Consider subscribing to the Symfony Roadmap Notifications.

+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-5-4-49-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Fri, 29 Nov 2024 09:39:54 +0100 + https://symfony.com/blog/symfony-5-4-49-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[SymfonyCon Vienna 2024: See you next week!]]> + https://symfony.com/blog/symfonycon-vienna-2024-see-you-next-week?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + + +SymfonyCon Vienna is just around the corner! 🎉 Next week, we’ll come together for an exciting event featuring brand-new talks, inspiring speakers, and everything you need to make the most of this gathering with the Symfony and PHP community. + +💡Pro… + + Sfconvienna2024 Blog + +SymfonyCon Vienna is just around the corner! 🎉 Next week, we’ll come together for an exciting event featuring brand-new talks, inspiring speakers, and everything you need to make the most of this gathering with the Symfony and PHP community.

+ +

💡Pro tip: Use the business meeting feature in your SymfonyLive profile to schedule meetings with sponsors ahead of time!

+ +

Not registered yet? Don’t miss out—there’s still time to grab your tickets for:

+ +
    +
  • December 3-4: Workshop Days – Choose from a variety of 1-day training sessions. Spots are filling fast!
  • +
  • December 5-6: Conference Days – Dive into 3 parallel tracks plus an unconference track, all in English.
  • +
+ +
+ +

🆕What's new in the schedule

+ + + +

🔎 Explore the great lineup of talks

+ +

In just a few days, you'll meet our inspiring experts speakers as Fabien Potencier, Viktor Pikaev, Andreas Braun, Michelle Sanver, , Ondřej Mirtes, Alexander M. Turek, David Buchmann, Marie Minasyan, Nils Adermann, Anne-Julia Seitz, Thibault Milan, Romain Ruaud, Juliette Reinders Folmer, Dave Liddament, Rob Allen, Tugdual Saunier, Simon André, Mathias Arlaud, Adrien Roches, Hubert Lenoir, Antoine Bluchet, Alexander Schranz, Alexandre Salomé, Kévin Dunglas, Nicolas Grekas, Sebastian Plagemann, Stephan Hochdörfer, Raphaël Geffroy, Peter Dietrich, Céline Deis, Johannes Wachter, Matheo Daninos, Robin Chalas, Paul Dragoonis, Antonis Kalipetis, Guillaume Moigneu, Florent Huck, Augustin Delaporte, Celeste Van Der Watt, Greg Qualls, Thomas di Luccio, Nigel Kersten, Moritz Schuh, Sebastian Seggewiß, Haylee Millar and, Kemi Elizabeth Ojogbede.

+ +

Read the detailed content of talks here.

+ +

🧑‍💻Unlock new skills and level up your expertise with our workshops!

+ +

Held on December 3-4, 2024, these workshops are crafted for developers eager to dive deep into Symfony, PHP, and modern coding practices. Here’s what you can look forward to:

+ + + +

Whether you're new to Symfony or looking to master advanced techniques, there’s something here for everyone. Don't miss the chance to learn directly from Symfony experts and apply your skills to real-world projects. Secure your spot now and get ready to accelerate your Symfony journey!

+ +

🎟️ Select the ticket of your choice

+ +

Register by clicking on Buy ticket and choose your ticket:

+ +
    +
  • "Workshops only", December 3-4
  • +
  • "Conference only", December 5-6
  • +
  • Combo ticket "Conference + Workshops" to live a full Symfony week experience!
  • +
+ +

🫵 Participate in the Unconference track

+ +

The Unconference track is a participant-driven format where attendees shape the content and discussions in real-time. Have a topic you're passionate about? Claim your slot by emailing us at events@symfony.com and set the stage for an unforgettable experience.

+ +

Each unconference talk lasts 20 minutes with a screen and projector available on both days.

+ +

🧳 Plan your participation

+ +
    +
  • Use the schedule to organize your visit.

  • +
  • Read our attendee guide for venue, accommodation, and transportation details.

  • +
  • Use the business meeting feature in your Symfony Live profile to schedule meetings with sponsors ahead of time!

  • +
+ +

🎉 Plan to attend the community evening on Thursday, December 5

+ +

Join us for a "Night at the Museum" at one of Vienna's most iconic place: Naturhistorisches Museum Wien (20 minutes by public transport from the conference). From 7:30-10:30 pm. Drinks, music & access to parts of permanent exhibition included!

+ +

💻 Save the date for the Symfony hackathon on Saturday, December 7

+ +

Everyone is welcome to join the hackday! Whether you're an experienced contributor or new to the community, your participation is highly valued as it brings a fresh perspective! More details are available here. Address: Stockwerk, Pater-Schwartz-Gasse 11A, 1150 Wien - Map

+ +

💡 Follow the "conferences" blog posts to stay updated!

+ +

We can't wait to meet you in person to learn and share the latest about Symfony. Join us and be part of the @symfony community! 🫶

+ +
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfonycon-vienna-2024-see-you-next-week?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Thu, 28 Nov 2024 15:45:00 +0100 + https://symfony.com/blog/symfonycon-vienna-2024-see-you-next-week?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[New in Symfony 7.2: Misc. Improvements (Part 2)]]> + https://symfony.com/blog/new-in-symfony-7-2-misc-improvements-part-2?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + +Access to the Estimated Password Strength + + + + + + + + Contributed by + Yannick + in + #54881… + +

Access to the Estimated Password Strength

+
+
+ + Yannick + +
+
+ Contributed by + Yannick + in + #54881 + +
+
+

The PasswordStrength constraint validates that the given password has reached +a minimum strength configured in the constraint. In Symfony 7.2, we've changed +the visibility of the estimateStrength() validator method from private to public.

+

This allows you to access the estimated password strength and display it, for +example, in the interface, so users can better understand the quality of their +passwords.

+ +
+

Simpler RequestStack Unit Testing

+
+
+ + Alexander Schranz + +
+
+ Contributed by + Alexander Schranz + in + #57909 + +
+
+

When using the RequestStack in unit tests, you previously needed code like +this to configure the requests:

+
+
+ +
$requestStack = new RequestStack();
+$requestStack->push(Request::create('/'));
+$someCustomClass = new MyCustomClass($requestStack);
+
+
+

In Symfony 7.2, we've simplified this by adding a constructor to RequestStack +that accepts an array of requests:

+
+
+ +
$someCustomClass = new MyCustomClass(new RequestStack([
+    Request::create('/'),
+]));
+
+
+
+
+

Default Action in the HTML Sanitizer

+
+
+ + Jordi Boggiano + +
+
+ Contributed by + Jordi Boggiano + in + #57399 + +
+
+

In Symfony 7.2, we've added a new defaultAction() method in the HtmlSanitizer component. +This method sets the default action for elements that are not explicitly allowed +or blocked:

+
+
+ +
use Symfony\Component\HtmlSanitizer\HtmlSanitizer;
+use Symfony\Component\HtmlSanitizer\HtmlSanitizerAction;
+
+$config = (new HtmlSanitizerConfig())
+    ->defaultAction(HtmlSanitizerAction::Block)
+    ->allowElement('p');
+
+$sanitizer = new HtmlSanitizer($config);
+
+
+

HtmlSanitizerAction is a PHP enum with three cases: Drop (removes the element +and its children); Block (removes the element but keeps its children); and Allow +(keeps the element).

+
+
+

Allow Using defaultNull() on Boolean Nodes

+
+
+ + Alexandre Daubois + +
+
+ Contributed by + Alexandre Daubois + in + #58490 + +
+
+

The current defaultNull() of BooleanNode, used when +defining and processing configuration values, casts null values to true. +In Symfony 7.2, we've updated this method so you can define nullable boolean +values properly:

+
+
+ +
->booleanNode('enabled')->defaultNull()->end()
+
+
+
+
+

Better IP Address Anonymization

+
+
+ + Alexandre Daubois + +
+
+ Contributed by + Alexandre Daubois + in + #58038 + +
+
+

The IpUtils class includes an anonymize() method to obscure part of the IP +address for user privacy. In Symfony 7.2, we've added two new arguments to this +method so you can specify how many bytes to anonymize:

+
+
+ +
use Symfony\Component\HttpFoundation\IpUtils;
+
+$ipv4 = '123.234.235.236';
+// for IPv4 addresses, you can hide 0 to 4 bytes
+$anonymousIpv4 = IpUtils::anonymize($ipv4, 3);
+// $anonymousIpv4 = '123.0.0.0'
+
+$ipv6 = '2a01:198:603:10:396e:4789:8e99:890f';
+// for IPv6 addresses, you can hide 0 to 16 bytes
+// (you must define the second argument (bytes to anonymize in IPv4 addresses)
+// even when you are only anonymizing IPv6 addresses)
+$anonymousIpv6 = IpUtils::anonymize($ipv6, 3, 10);
+// $anonymousIpv6 = '2a01:198:603::'
+
+
+
+
+

String Configuration Node

+
+
+ + Raffaele Carelle + +
+
+ Contributed by + Raffaele Carelle + in + #58428 + +
+
+

When defining a configuration tree, you can use many node types for +configuration values (boolean, integers, floats, enums, arrays, etc.). However, +you couldn't define string values directly; they were specified as scalar nodes.

+

In Symfony 7.2, we've added a string node type and a stringNode() method, +allowing you to define configuration values as strings explicitly:

+
+
+ +
$rootNode
+    ->children()
+        // ...
+        ->stringNode('username')
+            ->defaultValue('root')
+        ->end()
+        ->stringNode('password')
+            ->defaultValue('root')
+        ->end()
+    ->end()
+;
+
+
+
+
+

Security Profiler Improvements

+
+
+ + Mathieu + +
+
+ Contributed by + Mathieu + in + #57525 + , #57369 + and #57692 + +
+
+

In Symfony 7.2, the security panel of the Symfony Profiler has been improved +with several new features. First, the authenticators tab has been updated. +Previously, authenticators that didn't support the request were not shown:

+
+ Symfony security profiler panel with no authenticator shown +
+

Now, to make debugging easier, you can see all the application's authenticators. +If an authenticator doesn't support the request, it will be labeled as "not supported":

+
+ Symfony 7.2 security profiler panel with all authenticators shown +
+

When using a stateful firewall, the token tab of de-authenticated users now +includes a link to the request that contained the previously authenticated user:

+
+ Symfony 7.2 security profiler panel with a link to previous authenticated user +
+

The authenticators tab has also been redesigned to display information more +clearly. It now also shows whether an authenticator is lazy and includes any exception +passed to the onAuthenticationFailure() method:

+
+ Symfony 7.2 security profiler panel with more and redesigned information in the authenticators tab +
+
+

This is the final blog post in the New in Symfony 7.2 series. We hope you +enjoyed it and discovered some of the great new features introduced in Symfony 7.2. +Check out the Symfony minor version upgrade guide to learn how to upgrade to 7.2 +from other 7.x versions. Meanwhile, we've already started working on Symfony 7.3, +which will be released at the end of May 2025.

+
+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/new-in-symfony-7-2-misc-improvements-part-2?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Thu, 28 Nov 2024 08:40:00 +0100 + https://symfony.com/blog/new-in-symfony-7-2-misc-improvements-part-2?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 7.1.9 released]]> + https://symfony.com/blog/symfony-7-1-9-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 7.1.9 has just been released. +Here is the list of the most important changes since 7.1.8: + + bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas) +bug #58562 [HttpClient] Close gracefull when the server closes… + Symfony 7.1.9 has just been released. +Here is the list of the most important changes since 7.1.8:

+
    +
  • bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas)
  • +
  • bug #58562 [HttpClient] Close gracefull when the server closes the connection abruptly (@discordier)
  • +
  • bug #59007 [Dotenv] read runtime config from composer.json in debug dotenv command (@xabbuh)
  • +
  • bug #58963 [PropertyInfo] Fix write visibility for Asymmetric Visibility and Virtual Properties (@xabbuh, @pan93412)
  • +
  • bug #58983 [Translation] [Bridge][Lokalise] Fix empty keys array in PUT, DELETE requests causing Lokalise API error (@DominicLuidold)
  • +
  • bug #58956 [DoctrineBridge] Fix Connection::createSchemaManager() for Doctrine DBAL v2 (@neodevcode)
  • +
  • bug #58959 [PropertyInfo] consider write property visibility to decide whether a property is writable (@xabbuh)
  • +
  • bug #58964 [TwigBridge] do not add child nodes to EmptyNode instances (@xabbuh)
  • +
  • bug #58952 [Cache] silence warnings issued by Redis Sentinel on connection issues (@xabbuh)
  • +
  • bug #58859 [AssetMapper] ignore missing directory in isVendor() (@alexislefebvre)
  • +
  • bug #58917 [OptionsResolver] Allow Union/Intersection Types in Resolved Closures (@zanbaldwin)
  • +
  • bug #58822 [DependencyInjection] Fix checking for interfaces in ContainerBuilder::getReflectionClass() (@donquixote)
  • +
  • bug #58865 Dynamically fix compatibility with doctrine/data-fixtures v2 (@greg0ire)
  • +
  • bug #58921 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception (@lyrixx)
  • +
  • bug #58908 [DoctrineBridge] don't call EntityManager::initializeObject() with scalar values (@xabbuh)
  • +
  • bug #58938 [Cache] make RelayProxyTrait compatible with relay extension 0.9.0 (@xabbuh)
  • +
  • bug #58924 [HttpClient] Fix empty hosts in option "resolve" (@nicolas-grekas)
  • +
  • bug #58915 [HttpClient] Fix option "resolve" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58919 [WebProfilerBundle] Twig deprecations (@mazodude)
  • +
  • bug #58914 [HttpClient] Fix option "bindto" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58870 [Serializer][Validator] prevent failures around not existing TypeInfo classes (@xabbuh)
  • +
  • bug #58872 [PropertyInfo][Serializer][Validator] TypeInfo 7.2 compatibility (@mtarld)
  • +
  • bug #58875 [HttpClient] Removed body size limit (Carl Julian Sauter)
  • +
  • bug #58866 [Validator] fix compatibility with PHP < 8.2.4 (@xabbuh)
  • +
  • bug #58862 [Notifier] Fix GoIpTransport (@nicolas-grekas)
  • +
  • bug #58860 [HttpClient] Fix catching some invalid Location headers (@nicolas-grekas)
  • +
  • bug #58836 Work around parse_url() bug (bis) (@nicolas-grekas)
  • +
  • bug #58818 [Messenger] silence PHP warnings issued by Redis::connect() (@xabbuh)
  • +
  • bug #58828 [PhpUnitBridge] fix dumping tests to skip with data providers (@xabbuh)
  • +
  • bug #58842 [Routing] Fix: lost priority when defining hosts in configuration (@BeBlood)
  • +
  • bug #58850 [HttpClient] fix PHP 7.2 compatibility (@xabbuh)
  • +
+

Want to upgrade to this new release? Because Symfony protects +backwards-compatibility very closely, this should be quite easy. Use +SymfonyInsight upgrade reports +to detect the code you will need to change in your project and +read our upgrade +documentation to learn more.

+

Want to be notified whenever a new Symfony release is published? Or when a +version is not maintained anymore? Or only when a security issue is fixed? +Consider subscribing to the Symfony Roadmap Notifications.

+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-7-1-9-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Wed, 27 Nov 2024 14:02:38 +0100 + https://symfony.com/blog/symfony-7-1-9-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 6.4.16 released]]> + https://symfony.com/blog/symfony-6-4-16-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 6.4.16 has just been released. +Here is the list of the most important changes since 6.4.15: + + bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas) +bug #58562 [HttpClient] Close gracefull when the server closes… + Symfony 6.4.16 has just been released. +Here is the list of the most important changes since 6.4.15:

+
    +
  • bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas)
  • +
  • bug #58562 [HttpClient] Close gracefull when the server closes the connection abruptly (@discordier)
  • +
  • bug #59007 [Dotenv] read runtime config from composer.json in debug dotenv command (@xabbuh)
  • +
  • bug #58963 [PropertyInfo] Fix write visibility for Asymmetric Visibility and Virtual Properties (@xabbuh, @pan93412)
  • +
  • bug #58983 [Translation] [Bridge][Lokalise] Fix empty keys array in PUT, DELETE requests causing Lokalise API error (@DominicLuidold)
  • +
  • bug #58956 [DoctrineBridge] Fix Connection::createSchemaManager() for Doctrine DBAL v2 (@neodevcode)
  • +
  • bug #58959 [PropertyInfo] consider write property visibility to decide whether a property is writable (@xabbuh)
  • +
  • bug #58964 [TwigBridge] do not add child nodes to EmptyNode instances (@xabbuh)
  • +
  • bug #58952 [Cache] silence warnings issued by Redis Sentinel on connection issues (@xabbuh)
  • +
  • bug #58859 [AssetMapper] ignore missing directory in isVendor() (@alexislefebvre)
  • +
  • bug #58917 [OptionsResolver] Allow Union/Intersection Types in Resolved Closures (@zanbaldwin)
  • +
  • bug #58822 [DependencyInjection] Fix checking for interfaces in ContainerBuilder::getReflectionClass() (@donquixote)
  • +
  • bug #58865 Dynamically fix compatibility with doctrine/data-fixtures v2 (@greg0ire)
  • +
  • bug #58921 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception (@lyrixx)
  • +
  • bug #58908 [DoctrineBridge] don't call EntityManager::initializeObject() with scalar values (@xabbuh)
  • +
  • bug #58938 [Cache] make RelayProxyTrait compatible with relay extension 0.9.0 (@xabbuh)
  • +
  • bug #58924 [HttpClient] Fix empty hosts in option "resolve" (@nicolas-grekas)
  • +
  • bug #58915 [HttpClient] Fix option "resolve" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58919 [WebProfilerBundle] Twig deprecations (@mazodude)
  • +
  • bug #58914 [HttpClient] Fix option "bindto" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58875 [HttpClient] Removed body size limit (Carl Julian Sauter)
  • +
  • bug #58862 [Notifier] Fix GoIpTransport (@nicolas-grekas)
  • +
  • bug #58860 [HttpClient] Fix catching some invalid Location headers (@nicolas-grekas)
  • +
  • bug #58836 Work around parse_url() bug (bis) (@nicolas-grekas)
  • +
  • bug #58818 [Messenger] silence PHP warnings issued by Redis::connect() (@xabbuh)
  • +
  • bug #58828 [PhpUnitBridge] fix dumping tests to skip with data providers (@xabbuh)
  • +
  • bug #58842 [Routing] Fix: lost priority when defining hosts in configuration (@BeBlood)
  • +
  • bug #58850 [HttpClient] fix PHP 7.2 compatibility (@xabbuh)
  • +
+

Want to upgrade to this new release? Because Symfony protects +backwards-compatibility very closely, this should be quite easy. Use +SymfonyInsight upgrade reports +to detect the code you will need to change in your project and +read our upgrade +documentation to learn more.

+

Want to be notified whenever a new Symfony release is published? Or when a +version is not maintained anymore? Or only when a security issue is fixed? +Consider subscribing to the Symfony Roadmap Notifications.

+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-6-4-16-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Wed, 27 Nov 2024 13:54:27 +0100 + https://symfony.com/blog/symfony-6-4-16-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+ + <![CDATA[Symfony 5.4.48 released]]> + https://symfony.com/blog/symfony-5-4-48-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + Symfony 5.4.48 has just been released. +Here is the list of the most important changes since 5.4.47: + + bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas) +bug #58562 [HttpClient] Close gracefull when the server closes… + Symfony 5.4.48 has just been released. +Here is the list of the most important changes since 5.4.47:

+
    +
  • bug #59013 [HttpClient] Fix checking for private IPs before connecting (@nicolas-grekas)
  • +
  • bug #58562 [HttpClient] Close gracefull when the server closes the connection abruptly (@discordier)
  • +
  • bug #59007 [Dotenv] read runtime config from composer.json in debug dotenv command (@xabbuh)
  • +
  • bug #58963 [PropertyInfo] Fix write visibility for Asymmetric Visibility and Virtual Properties (@xabbuh, @pan93412)
  • +
  • bug #58983 [Translation] [Bridge][Lokalise] Fix empty keys array in PUT, DELETE requests causing Lokalise API error (@DominicLuidold)
  • +
  • bug #58959 [PropertyInfo] consider write property visibility to decide whether a property is writable (@xabbuh)
  • +
  • bug #58964 [TwigBridge] do not add child nodes to EmptyNode instances (@xabbuh)
  • +
  • bug #58822 [DependencyInjection] Fix checking for interfaces in ContainerBuilder::getReflectionClass() (@donquixote)
  • +
  • bug #58865 Dynamically fix compatibility with doctrine/data-fixtures v2 (@greg0ire)
  • +
  • bug #58921 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception (@lyrixx)
  • +
  • bug #58908 [DoctrineBridge] don't call EntityManager::initializeObject() with scalar values (@xabbuh)
  • +
  • bug #58924 [HttpClient] Fix empty hosts in option "resolve" (@nicolas-grekas)
  • +
  • bug #58915 [HttpClient] Fix option "resolve" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58919 [WebProfilerBundle] Twig deprecations (@mazodude)
  • +
  • bug #58914 [HttpClient] Fix option "bindto" with IPv6 addresses (@nicolas-grekas)
  • +
  • bug #58875 [HttpClient] Removed body size limit (Carl Julian Sauter)
  • +
  • bug #58860 [HttpClient] Fix catching some invalid Location headers (@nicolas-grekas)
  • +
  • bug #58836 Work around parse_url() bug (bis) (@nicolas-grekas)
  • +
  • bug #58818 [Messenger] silence PHP warnings issued by Redis::connect() (@xabbuh)
  • +
  • bug #58828 [PhpUnitBridge] fix dumping tests to skip with data providers (@xabbuh)
  • +
  • bug #58842 [Routing] Fix: lost priority when defining hosts in configuration (@BeBlood)
  • +
  • bug #58850 [HttpClient] fix PHP 7.2 compatibility (@xabbuh)
  • +
+

Want to upgrade to this new release? Because Symfony protects +backwards-compatibility very closely, this should be quite easy. Use +SymfonyInsight upgrade reports +to detect the code you will need to change in your project and +read our upgrade +documentation to learn more.

+

Want to be notified whenever a new Symfony release is published? Or when a +version is not maintained anymore? Or only when a security issue is fixed? +Consider subscribing to the Symfony Roadmap Notifications.

+
+
+ Sponsor the Symfony project. +
+ ]]>
+ https://symfony.com/blog/symfony-5-4-48-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed + + Wed, 27 Nov 2024 13:48:58 +0100 + https://symfony.com/blog/symfony-5-4-48-released?utm_source=Symfony%20Blog%20Feed&utm_medium=feed#comments-list +
+
+
diff --git a/tests/ProfilerSubscriberTest.php b/tests/ProfilerSubscriberTest.php index 8d02dff..8ada6fd 100644 --- a/tests/ProfilerSubscriberTest.php +++ b/tests/ProfilerSubscriberTest.php @@ -28,10 +28,10 @@ public function testAjaxReplaceHeaderNotSet(int $requestType, bool $debug, bool $response = new Response(); $event = new ResponseEvent($this->createMock(Kernel::class), new Request(), $requestType, $response); - $listener = new ProfilerSubscriber($debug); - $listener->onKernelResponse($event); + $subscriber = new ProfilerSubscriber($debug); + $subscriber->onKernelResponse($event); - $this->assertFalse($response->headers->has('Symfony-Debug-Toolbar-Replace')); + self::assertFalse($response->headers->has('Symfony-Debug-Toolbar-Replace')); } /** @@ -53,9 +53,15 @@ public function testAjaxReplaceHeaderOnEnabledAndXHR(): void $response = new Response(); $event = new ResponseEvent($this->createMock(Kernel::class), $request, HttpKernelInterface::MAIN_REQUEST, $response); - $listener = new ProfilerSubscriber(true); - $listener->onKernelResponse($event); + $subscriber = new ProfilerSubscriber(true); + $subscriber->onKernelResponse($event); - $this->assertEquals('1', $response->headers->get('Symfony-Debug-Toolbar-Replace')); + self::assertEquals('1', $response->headers->get('Symfony-Debug-Toolbar-Replace')); + } + + public function testSubscriberIsSubscribedToResponseEvent(): void + { + self::assertArrayHasKey(ResponseEvent::class, ProfilerSubscriber::getSubscribedEvents()); + self::assertIsString(ProfilerSubscriber::getSubscribedEvents()[ResponseEvent::class]); } }