Skip to content

Conversation

@ondrejmirtes
Copy link
Contributor

@ondrejmirtes ondrejmirtes commented Dec 3, 2025

It was above method signature for PHP 5.5 to 8.2.

@LolGleb
Copy link
Contributor

LolGleb commented Dec 4, 2025

Thanks for the PR! I understand adding #[NoDiscard] to the 8.3+ version makes sense. However, I'm curious why you removed it from the 5.5-8.2 version? Both versions have the same immutable behavior, so shouldn't both warn that the return value should be captured?

@ondrejmirtes
Copy link
Contributor Author

I removed it from The 5.5-8.2 version because #[NoDiscard] is a PHP 8.5+ feature so it didn't seem relevant?

Can you confirm that PhpStorm would take advantage of the attribute even when the language level is set to PHP 8.2?

@LolGleb
Copy link
Contributor

LolGleb commented Dec 4, 2025

You are absolutely right! The attribute does not affect earlier versions of PHP, so even if we leave the attribute for earlier versions, it simply won't do anything

@LolGleb LolGleb merged commit 3612038 into JetBrains:master Dec 4, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants