Skip to content

Commit 78be7eb

Browse files
committed
[JsonStreamer] Add PHPDoc to generated code
1 parent f4f3a32 commit 78be7eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+198
-0
lines changed

src/Symfony/Component/JsonStreamer/Read/PhpGenerator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function generate(DataModelNodeInterface $dataModel, bool $decodeFromStre
5151
if ($decodeFromStream) {
5252
return $this->line('<?php', $context)
5353
.$this->line('', $context)
54+
.$this->line('/**', $context)
55+
.$this->line(' * @return '.$dataModel->getType(), $context)
56+
.$this->line(' */', $context)
5457
.$this->line('return static function (mixed $stream, \\'.ContainerInterface::class.' $valueTransformers, \\'.LazyInstantiator::class.' $instantiator, array $options): mixed {', $context)
5558
.$providers
5659
.($this->canBeDecodedWithJsonDecode($dataModel, $decodeFromStream)
@@ -61,6 +64,9 @@ public function generate(DataModelNodeInterface $dataModel, bool $decodeFromStre
6164

6265
return $this->line('<?php', $context)
6366
.$this->line('', $context)
67+
.$this->line('/**', $context)
68+
.$this->line(' * @return '.$dataModel->getType(), $context)
69+
.$this->line(' */', $context)
6470
.$this->line('return static function (string|\\Stringable $string, \\'.ContainerInterface::class.' $valueTransformers, \\'.Instantiator::class.' $instantiator, array $options): mixed {', $context)
6571
.$providers
6672
.($this->canBeDecodedWithJsonDecode($dataModel, $decodeFromStream)

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/backed_enum.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum'] = static function ($data) {
58
return \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum::from($data);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/backed_enum.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum'] = static function ($stream, $offset, $length) {
58
return \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum::from(\Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $offset, $length));
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return array<string,mixed>
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) $string);
58
};

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/dict.stream.php

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

3+
/**
4+
* @return array<string,mixed>
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<string,mixed>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return iterable
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) $string);
58
};

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/iterable.stream.php

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

3+
/**
4+
* @return iterable
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['iterable'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return array<int,mixed>
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) $string);
58
};

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/list.stream.php

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

3+
/**
4+
* @return array<int,mixed>
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<int,mixed>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitList($stream, $offset, $length);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return mixed
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) $string);
58
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return mixed
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, 0, null);
58
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return null
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeString((string) $string);
58
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
/**
4+
* @return null
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
return \Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, 0, null);
58
};

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_backed_enum.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum|null
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum'] = static function ($data) {
58
return \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum::from($data);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_backed_enum.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum|null
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum'] = static function ($stream, $offset, $length) {
58
return \Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum::from(\Symfony\Component\JsonStreamer\Read\Decoder::decodeStream($stream, $offset, $length));

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy|null
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy::class, \array_filter(['id' => $data['id'] ?? '_symfony_missing_value', 'name' => $data['name'] ?? '_symfony_missing_value'], static function ($v) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy|null
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_dict.php

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

3+
/**
4+
* @return array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$iterable = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_dict.stream.php

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

3+
/**
4+
* @return array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_list.php

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

3+
/**
4+
* @return array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$iterable = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/nullable_object_list.stream.php

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

3+
/**
4+
* @return array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>|null
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitList($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy::class, \array_filter(['id' => $data['id'] ?? '_symfony_missing_value', 'name' => $data['name'] ?? '_symfony_missing_value'], static function ($v) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_dict.php

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

3+
/**
4+
* @return array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$iterable = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_dict.stream.php

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

3+
/**
4+
* @return array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_in_object.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies::class, \array_filter(['name' => $data['name'] ?? '_symfony_missing_value', 'otherDummyOne' => \array_key_exists('otherDummyOne', $data) ? $providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNameAttributes']($data['otherDummyOne']) : '_symfony_missing_value', 'otherDummyTwo' => \array_key_exists('otherDummyTwo', $data) ? $providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy']($data['otherDummyTwo']) : '_symfony_missing_value'], static function ($v) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_in_object.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithOtherDummies'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_iterable.php

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

3+
/**
4+
* @return iterable<int|string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['iterable<int|string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$iterable = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_iterable.stream.php

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

3+
/**
4+
* @return iterable<int|string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['iterable<int|string,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_list.php

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

3+
/**
4+
* @return array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$iterable = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_list.stream.php

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

3+
/**
4+
* @return array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['array<int,Symfony\Component\JsonStreamer\Tests\Fixtures\Model\ClassicDummy>'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitList($stream, $offset, $length);

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_nullable_properties.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties
5+
*/
36
return static function (string|\Stringable $string, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\Instantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties'] = static function ($data) use ($options, $valueTransformers, $instantiator, &$providers) {
58
return $instantiator->instantiate(\Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties::class, \array_filter(['name' => $data['name'] ?? '_symfony_missing_value', 'enum' => \array_key_exists('enum', $data) ? $providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Enum\DummyBackedEnum|null']($data['enum']) : '_symfony_missing_value'], static function ($v) {

src/Symfony/Component/JsonStreamer/Tests/Fixtures/stream_reader/object_with_nullable_properties.stream.php

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

3+
/**
4+
* @return Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties
5+
*/
36
return static function (mixed $stream, \Psr\Container\ContainerInterface $valueTransformers, \Symfony\Component\JsonStreamer\Read\LazyInstantiator $instantiator, array $options): mixed {
47
$providers['Symfony\Component\JsonStreamer\Tests\Fixtures\Model\DummyWithNullableProperties'] = static function ($stream, $offset, $length) use ($options, $valueTransformers, $instantiator, &$providers) {
58
$data = \Symfony\Component\JsonStreamer\Read\Splitter::splitDict($stream, $offset, $length);

0 commit comments

Comments
 (0)