Skip to content

Commit 4cb36ef

Browse files
Merge branch '7.3' into 7.4
* 7.3: [Config] Fix `ReflectionClassResource` hash validation [Cache] Fix internal representation of non-static values [Cache] Make `TagAwareAdapter` registrable as a service refactor: Unify & more humane translation message fix Resources translations validators.pt.xlf [Security] Pass attributes to nested `ChainUserProviders` [Validator] Update translation for the Video constraint [Messenger] Firebird Database - incompatibility with expected lowercase columns SQLSRV: Change column type from TEXT to STRING Fix exception catch when deleting temporary table in the sameDatabaseChecker [JsonStreamer] Fix encoding iterable lists [Serializer] Fix serializer crash due to asymmetric visibility on `protected(set)` properties [DependencyInjection] Respect original service class when a proxy is defined
2 parents dba6d86 + 3b95534 commit 4cb36ef

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Tests/JsonStreamWriterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testWriteCollection()
107107
);
108108

109109
$this->assertWritten(
110-
'{"0":{"id":1,"name":"dummy"},"1":{"id":1,"name":"dummy"}}',
110+
'[{"id":1,"name":"dummy"},{"id":1,"name":"dummy"}]',
111111
new \ArrayObject([new ClassicDummy(), new ClassicDummy()]),
112112
Type::iterable(Type::object(ClassicDummy::class), Type::int()),
113113
);

Write/PhpGenerator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ private function generateYields(DataModelNodeInterface $dataModelNode, array $op
191191
if ($dataModelNode instanceof CollectionNode) {
192192
++$context['depth'];
193193

194-
if ($dataModelNode->getType()->isList()) {
194+
$collectionKeyType = $dataModelNode->getType()->getCollectionKeyType();
195+
196+
if ($collectionKeyType instanceof BuiltinType && TypeIdentifier::INT === $collectionKeyType->getTypeIdentifier()) {
195197
$php = $this->yieldInterpolatedString('[', $context)
196198
.$this->flushYieldBuffer($context)
197199
.$this->line('$prefix'.$context['depth'].' = \'\';', $context)

0 commit comments

Comments
 (0)