8000 Fix `ConstraintViolation#getMessageTemplate()` to always return `string` by Ocramius · Pull Request #40416 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix ConstraintViolation#getMessageTemplate() to always return string #40416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Ocramius
Copy link
Contributor
@Ocramius Ocramius commented Mar 8, 2021
Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

ConstraintViolation#getMessageTemplate()'s inherited signature states that string is
to be returned by it at all times, yet the implementation returns null when no message
template had been provided at instantiation.

This patch obviates it, returning an empty string when the
message template is null.

Ref: #40415 (comment)

@carsonbot
Copy link

Hey!

Well done!, Im impressed by this PR.

I think @mdlutz24 has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@fabpot fabpot changed the base branch from 5.x to 5.2 March 10, 2021 07:42
@fabpot fabpot force-pushed the fix/ensure-message-template-respects-declared-interface-type branch from cb47a35 to f6e9132 Compare March 10, 2021 07:42
@fabpot fabpot changed the base branch from 5.2 to 5.x March 10, 2021 07:43
@fabpot
Copy link
Member
fabpot commented Mar 10, 2021

Can you rebase on the 5.2 branch (I cannot do it for you as I cannot push to your branch). Thank you.

`ConstraintViolation#getMessageTemplate()`'s inherited signature states that `string` is
to be returned by it at all times, yet the implementation returns `null` when no message
template had been provided at instantiation.

This patch obviates it, returning an empty string when the
message template is `null`.

Ref: symfony#40415 (comment)
@Ocramius Ocramius force-pushed the fix/ensure-message-template-respects-declared-interface-type branch from f6e9132 to 72a464e Compare March 10, 2021 10:00
@Ocramius Ocramius changed the base branch from 5.x to 5.2 March 10, 2021 10:01
@fabpot
Copy link
Member
fabpot commented Mar 11, 2021

Thank you @Ocramius.

@fabpot fabpot merged commit dc8a43b into symfony:5.2 Mar 11, 2021
@fabpot fabpot mentioned this pull request Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0