Skip to content

symfony/security - minor issue in exception message #59328

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

Closed
alcohol opened this issue Dec 30, 2024 · 3 comments
Closed

symfony/security - minor issue in exception message #59328

alcohol opened this issue Dec 30, 2024 · 3 comments

Comments

@alcohol
Copy link
Contributor

alcohol commented Dec 30, 2024

Symfony version(s) affected

6.x and 7.x

Description

I think the arguments are the wrong way around? The message made sense in 5.4, but since 6.0 it seems to be the wrong way around.

5.4

trigger_deprecation('symfony/security-core', '5.3', 'Using the "%s" validation constraint without implementing the "%s" interface is deprecated, the "%s" class should implement it.', UserPassword::class, PasswordAuthenticatedUserInterface::class, get_debug_type($user));
and
trigger_deprecation('symfony/security-core', '5.3', 'Returning a string from "getSalt()" without implementing the "%s" interface is deprecated, the "%s" class should implement it.', LegacyPasswordAuthenticatedUserInterface::class, get_debug_type($user));

6.0 and up

throw new ConstraintDefinitionException(sprintf('The "%s" class must implement the "%s" interface.', PasswordAuthenticatedUserInterface::class, get_debug_type($user)));

7.0 and up

throw new ConstraintDefinitionException(sprintf('The "%s" class must implement the "%s" interface.', PasswordAuthenticatedUserInterface::class, get_debug_type($user)));

How to reproduce

n/a

Possible Solution

No response

Additional Context

No response

@wouterj
Copy link
Member

wouterj commented Dec 30, 2024

Yes, what you're saying looks correct. Are you willing to open a pull request for the 6.4 branch to fix the order?

Status: Reviewed

@Link1515
Copy link
Contributor

Link1515 commented Jan 2, 2025

Hi, @alcohol @wouterj. I'd like to open a PR to fix this issue.

fabpot added a commit that referenced this issue Jan 2, 2025
…nk1515)

This PR was merged into the 6.4 branch.

Discussion
----------

[Security] Adjust parameter order in exception message

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59328
| License       | MIT

Commits
-------

4e1ba55 fix: modify Exception message parameter order
@fabpot fabpot closed this as completed Jan 2, 2025
@alcohol
Copy link
Contributor Author

alcohol commented Jan 3, 2025

Sorry @wouterj, been quite busy past few days. Submitted this issue as a reminder for myself to open a PR when I have the time. Looks like I don't have to do that anymore, thanks a lot @Link1515 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants