-
Notifications
You must be signed in to change notification settings - Fork 672
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
PHP 8.2: seal all properties configuration #7242
Conversation
I quite agree with the sentiment, but I'm not sure how PHP 8.2 changed anything here, so I don't see why the default should change based on this version Basically, PHP 8.2 throw a deprecated when using an undeclared property without __get or __set. Here, you suggest emitting an issue in Psalm even when __get or __set are present based only on @Property presence I'd be up for adding this config with a false default for Psalm 4 and switching it to true for Psalm 5. The default based on PHP version seems weird to me. (Note: I'm confused by the fact that there is an error on the assignment but not on the fetch here: https://psalm.dev/r/ce07ecb689 given that my config has the |
I found these snippets: https://psalm.dev/r/ce07ecb689<?php
/**
* @property bool $foo
* @property bool $foo2
*/
class A {
//public function __get(string $name) {}
//public function __set(string $name, bool $value) {}
}
class B extends A {}
$b = new B();
$b->foo = true;
$a = $b->foo2;
|
I think the idea was that people shouldn't do deprecated stuff. I don't think that's a bad idea but as a user I would also consider weird to have such impact when bumping my php version. The psalm4/psalm5 BC-break seems more natural. Also, I might not understand all the changes but
is returning always true for version 8.2 ; which means I cannot override the value with my config. And speaking about PHP 8.2, this should supports the |
47549b5
to
4445612
Compare
You're both right, I may have confused this task with another, different task regarding PHP 8.2 migration, sorry about this. |
Thanks! |
No description provided.