-
Notifications
You must be signed in to change notification settings - Fork 663
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
Report usage of depreacted properties #6118
Labels
Comments
I found these snippets: https://psalm.dev/r/34c8584df8<?php
class Foo
{
/**
* @deprecated
* @var int
*/
private $bar = 0;
public function bar(): int
{
return $this->bar;
}
}
|
Actually Psalm reports deprecated properties when they are accessed from outside of the class. I don't see a reason why we shouldn't report when accessed from the class scope. |
Moreover, we already report property writes: https://psalm.dev/r/66aa00201a |
I found these snippets: https://psalm.dev/r/66aa00201a<?php
class Foo
{
/**
* @deprecated
* @var int
*/
public $bar = 0;
public function bar(int $p): void
{
$this->bar = $p;
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a large class or a class with widely used public properties it may be difficult to immediately delete an unwanted property, and preferable to deprecate it.
I would like Psalm to report usages of deprecated properties, as at
https://psalm.dev/r/34c8584df8
The text was updated successfully, but these errors were encountered: