Skip to content

Commit 5b9ccde

Browse files
committed
bug symfony#38533 [TwigBridge] Fix preload hint and remove "unlinked class class@anonymous" warning (burned42)
This PR was merged into the 5.1 branch. Discussion ---------- [TwigBridge] Fix preload hint and remove "unlinked class class@anonymous" warning | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#38197 | License | MIT | Doc PR | n/a This should fix the preload warning mentioned in symfony#38197 by applying the fix as suggested by @nicolas-grekas: ``` PHP Warning: Can't preload unlinked class class@anonymous: Unknown trait Symfony\\Contracts\\Translation\\TranslatorTrait in /var/www/html/vendor/symfony/twig-bridge/Extension/TranslationExtension.php on line 50 ``` Commits ------- 0f167f6 fix warning for preloading TranslatorTrait class
2 parents b9e76b2 + 0f167f6 commit 5b9ccde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Bridge/Twig/Extension/TranslationExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
// Help opcache.preload discover always-needed symbols
2525
class_exists(TranslatorInterface::class);
26+
class_exists(TranslatorTrait::class);
2627

2728
/**
2829
* Provides integration of the Translation component with Twig.

0 commit comments

Comments
 (0)