8000 [Serializer] YamlLoader: groups must be an array · symfony/symfony@b8a9e7c · GitHub
[go: up one dir, main page]

Skip to content

Commit b8a9e7c

Browse files
committed
[Serializer] YamlLoader: groups must be an array
1 parent 1daed82 commit b8a9e7c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata)
7474
}
7575

7676
if (isset($data['groups'])) {
77+
if (!is_array($data['groups'])) {
78+
throw new MappingException('The "groups" key must be an array of strings.');
79+
}
80+
7781
foreach ($data['groups'] as $group) {
7882
if (!is_string($group)) {
7983
throw new MappingException('Group names must be strings.');

0 commit comments

Comments
 (0)
0