Skip to content

Commit 14192e9

Browse files
Merge branch '7.3' into 7.4
* 7.3: [FrameworkBundle] Fix wiring JsonStreamReader
2 parents e727725 + 7295d7a commit 14192e9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/json_streamer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\JsonStreamer\Mapping\Read\DateTimeTypePropertyMetadataLoader as ReadDateTimeTypePropertyMetadataLoader;
2222
use Symfony\Component\JsonStreamer\Mapping\Write\AttributePropertyMetadataLoader as WriteAttributePropertyMetadataLoader;
2323
use Symfony\Component\JsonStreamer\Mapping\Write\DateTimeTypePropertyMetadataLoader as WriteDateTimeTypePropertyMetadataLoader;
24+
use Symfony\Component\JsonStreamer\StreamerDumper;
2425
use Symfony\Component\JsonStreamer\ValueTransformer\DateTimeToStringValueTransformer;
2526
use Symfony\Component\JsonStreamer\ValueTransformer\StringToDateTimeValueTransformer;
2627

@@ -39,8 +40,8 @@
3940
tagged_locator('json_streamer.value_transformer'),
4041
service('json_streamer.read.property_metadata_loader'),
4142
param('.json_streamer.stream_readers_dir'),
43+
class_exists(StreamerDumper::class) ? service('config_cache_factory')->ignoreOnInvalid() : param('.json_streamer.lazy_ghosts_dir'),
4244
param('.json_streamer.lazy_ghosts_dir'),
43-
service('config_cache_factory')->ignoreOnInvalid(),
4445
])
4546
->alias(JsonStreamWriter::class, 'json_streamer.stream_writer')
4647
->alias(JsonStreamReader::class, 'json_streamer.stream_reader')

src/Symfony/Component/JsonStreamer/JsonStreamReader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ public function __construct(
4444
private ContainerInterface $valueTransformers,
4545
PropertyMetadataLoaderInterface $propertyMetadataLoader,
4646
string $streamReadersDir,
47+
ConfigCacheFactoryInterface|string|null $configCacheFactory = null,
4748
?string $lazyGhostsDir = null,
48-
?ConfigCacheFactoryInterface $configCacheFactory = null,
4949
) {
50+
if (\is_string($configCacheFactory)) {
51+
$lazyGhostsDir = $configCacheFactory;
52+
$configCacheFactory = null;
53+
}
5054
$this->streamReaderGenerator = new StreamReaderGenerator($propertyMetadataLoader, $streamReadersDir, $configCacheFactory);
5155
$this->instantiator = new Instantiator();
5256
$this->lazyInstantiator = new LazyInstantiator($lazyGhostsDir);

0 commit comments

Comments
 (0)