Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Form/Type/ImageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function (FormEvent $event) use ($options) {
if ($required) {
$fileFieldOptions['constraints'] = [
new NotBlank(
['message' => $options['required_image_error']]
message: $options['required_image_error']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Using a named argument here does not match NotBlank's constructor signature and will break at runtime.

NotBlank’s constructor takes an options array as its first (and only) argument, so ['message' => $options['required_image_error']] was correct. Using message: as a named parameter does not match the constructor and will cause a named-parameter runtime error. Please either revert to the array form or change this to new NotBlank(['message' => $options['required_image_error']]) to keep the behavior intact.

),
];
}
Expand Down