File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 14
14
use Psr \Log \LoggerInterface ;
15
15
use Symfony \Component \HttpKernel \CacheWarmer \CacheWarmerInterface ;
16
16
use Symfony \Component \Translation \TranslatorBagInterface ;
17
+ use Symfony \Contracts \Translation \TranslatorInterface ;
17
18
use Symfony \UX \Translator \TranslationsDumper ;
18
19
19
20
/**
24
25
class TranslationsCacheWarmer implements CacheWarmerInterface
25
26
{
26
27
public function __construct (
27
- private ? TranslatorBagInterface $ translatorBag ,
28
+ private TranslatorInterface | TranslatorBagInterface | null $ translatorBag ,
28
29
private TranslationsDumper $ translationsDumper ,
29
30
private readonly ?LoggerInterface $ logger = null ,
30
31
) {
@@ -37,7 +38,7 @@ public function isOptional(): bool
37
38
38
39
public function warmUp (string $ cacheDir , ?string $ buildDir = null ): array
39
40
{
40
- if (null === $ this ->translatorBag ) {
41
+ if (! $ this ->translatorBag instanceof TranslatorBagInterface ) {
41
42
$ this ->logger ?->warning('Translator bag not available ' );
42
43
43
44
return [];
Original file line number Diff line number Diff line change 14
14
use PHPUnit \Framework \TestCase ;
15
15
use Psr \Log \LoggerInterface ;
16
16
use Symfony \Component \Translation \MessageCatalogue ;
17
+ use Symfony \Component \Translation \Translator ;
17
18
use Symfony \Component \Translation \TranslatorBag ;
18
19
use Symfony \UX \Translator \CacheWarmer \TranslationsCacheWarmer ;
19
20
use Symfony \UX \Translator \TranslationsDumper ;
You can’t perform that action at this time.
0 commit comments