You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!array_intersect((array_keys($options)), ['normalizationContext', 'groups', 'context', 'value', 'denormalizationContext'])) {
39
42
// gracefully supports context as first, unnamed attribute argument if it cannot be confused with Doctrine-style options
40
43
$context = $options;
41
44
} else {
45
+
trigger_deprecation('symfony/serializer', '5.3', 'Passing an array of properties as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__);
46
+
42
47
// If at least one of the options match, it's likely to be Doctrine-style options. Search for the context inside:
if (!\is_string($groups) && !\is_array($groups)) {
52
+
thrownew \TypeError(sprintf('"%s": Expected parameter $groups to be a string or an array of strings, got "%s".', __METHOD__, get_debug_type($groups)));
trigger_deprecation('symfony/serializer', '5.3', 'Passing an array as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__);
thrownew \TypeError(sprintf('"%s": Parameter $groups is expected to be a string or an array of strings, got "%s".', __METHOD__, get_debug_type($groups)));
44
+
} elseif (isset($groups['value'])) {
45
+
trigger_deprecation('symfony/serializer', '5.3', 'Passing an array of properties as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__);
trigger_deprecation('symfony/serializer', '5.3', 'Passing an array as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__);
40
+
38
41
if (!isset($maxDepth['value'])) {
39
42
thrownewInvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', static::class));
trigger_deprecation('symfony/serializer', '5.3', 'Passing an array as first argument to "%s" is deprecated. Use named arguments instead.', __METHOD__);
40
+
38
41
if (!isset($serializedName['value'])) {
39
42
thrownewInvalidArgumentException(sprintf('Parameter of annotation "%s" should be set.', static::class));
0 commit comments