Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a3b877

Browse files
dunglasfabpot
authored andcommitted
[Serializer] Ensure that groups are strings
1 parent31aef7b commit0a3b877

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

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

7676
if (isset($data['groups'])) {
77+
if (!is_array($data['groups'])) {
78+
thrownewMappingException('The "groups" key must be an array of strings in "%s" for the attribute "%s" of the class "%s".',$this->file,$attribute,$classMetadata->getName());
79+
}
80+
7781
foreach ($data['groups']as$group) {
82+
if (!is_string($group)) {
83+
thrownewMappingException('Group names must be strings in "%s" for the attribute "%s" of the class "%s".',$this->file,$attribute,$classMetadata->getName());
84+
}
85+
7886
$attributeMetadata->addGroup($group);
7987
}
8088
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp