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

Add #[\NoDiscard] attribute to UriSigner check methods#61147

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexander-schranz wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromalexander-schranz:patch-10

Conversation

alexander-schranz
Copy link
Contributor

@alexander-schranzalexander-schranz commentedJul 17, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
IssuesKind of fixed and related to:#54297
LicenseMIT

There are sure more services which may be interesting but want to start with this one to discuss if we adopt:

https://wiki.php.net/rfc/marking_return_value_as_important

In the symfony workspace.

As I know there is nothing wrong to add a attribute which may not exist at that PHP version which we already had in the past with the ReturnTypeWillChange attributes.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.4" but it seems your PR description refers to branch "7.4 for features / 6.4, 7.2, or 7.3 for bug fixes".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

I wrote my opinion on#60429 (comment) before:

Ivoted against #[NoDiscard], so did@fabpot and I'm going to be 👎 here also: this attribute only contributes to make reading PHP code look like syntax soup, with no real value.

welcoMattic reacted with thumbs up emoji

@alexander-schranz
Copy link
ContributorAuthor

alexander-schranz commentedJul 17, 2025
edited
Loading

I see, never thought about have them on wither methods, as I maybe not personally fan of that pattern 😆.

For me it really only thought it handy forSecurity related things, likeUriSigner::checkRequest,Security::isGranted, ... where dangerous things could happen if somebody forget to check the false case (which we did have in one of our projects, where people thought checkRequest would throw exception and not require handle the return).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

3 participants
@alexander-schranz@carsonbot@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp