Skip to content

Commit ab0eb9b

Browse files
committed
ok
1 parent ea61d08 commit ab0eb9b

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

src/Hydra/State/JsonStreamerProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
4242
$data = $this->jsonStreamReader->read($request->getContent(true), Type::object($operation->getClass()));
4343
$context['request']->attributes->set('deserialized', true);
4444

45+
if (\PHP_VERSION_ID > 80400) {
46+
$refl = new \ReflectionClass($data);
47+
if ($refl->isUninitializedLazyObject($data)) {
48+
$refl->initializeLazyObject($data);
49+
}
50+
}
51+
4552
return $data;
4653
}
4754
}

src/Serializer/State/JsonStreamerProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public function provide(Operation $operation, array $uriVariables = [], array $c
4242
$data = $this->jsonStreamReader->read($request->getContent(true), Type::object($operation->getClass()));
4343
$context['request']->attributes->set('deserialized', true);
4444

45+
if (\PHP_VERSION_ID > 80400) {
46+
$refl = new \ReflectionClass($data);
47+
if ($refl->isUninitializedLazyObject($data)) {
48+
$refl->initializeLazyObject($data);
49+
}
50+
}
51+
4552
return $data;
4653
}
4754
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
tagged_locator('json_streamer.value_transformer'),
2222
service('api_platform.jsonld.json_streamer.write.property_metadata_loader'),
2323
'%.json_streamer.stream_writers_dir.jsonld%',
24+
service('config_cache_factory')->ignoreOnInvalid(),
2425
]);
2526

2627
$services->set('api_platform.jsonld.json_streamer.stream_reader', 'Symfony\Component\JsonStreamer\JsonStreamReader')
2728
->args([
2829
tagged_locator('json_streamer.value_transformer'),
2930
service('json_streamer.read.property_metadata_loader'),
3031
'%.json_streamer.stream_readers_dir.jsonld%',
31-
'%.json_streamer.lazy_ghosts_dir.jsonld%',
32+
service('config_cache_factory')->ignoreOnInvalid(),
3233
]);
3334

3435
$services->set('api_platform.jsonld.json_streamer.write.property_metadata_loader', 'ApiPlatform\JsonLd\JsonStreamer\WritePropertyMetadataLoader')

tests/Fixtures/app/config/reference.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
314
// This file is auto-generated and is for apps only. Bundles SHOULD NOT rely on its content.
415

516
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

0 commit comments

Comments
 (0)