CodeExplorerAnotherStruct example
$encoded );
} public function testNestedCollections(): void
{ $collection =
new StructCollection();
$nested =
new StructCollection();
$nested->
add(new MyTestStruct('nested1'
));
$nested->
add(new MyTestStruct('nested2'
));
$nested->
add(new AnotherStruct('nested3'
));
$collection->
add(new AnotherStruct('another1',
$nested));
$collection->
add(new AnotherStruct('another2'
));
$collection->
add(new MyTestStruct('myTest1'
));
$root =
new MyTestStruct('root',
$collection);
$fields =
new ResponseFields([ 'test-struct' =>
['foo', 'bar'
],
'another-struct' =>
['bar'
],
]);