You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing method/property attributes does not trigger analysis of dependent files because PHP Attributes are not taken into account in src/Dependency/ExportedNodeResolver.php.
Although questionable, attributes are part of public API in my opinion (even though accessible only via reflection), especially for tools like PHPStan where I expect migration from annotations to attributes in the near future (PHPStorm already pushes usage of #[Deprecated], #[ArrayShape],...)
Current behaviour makes it impossible to write rules that disallow calling #[Deprecated] methods whereas the same example with @deprecated works properly.
Let's assume we have a rule that forbids calling methods that are deprecated.
Then following will happen with current behaviour.
Code snippet that reproduces the problem
<?phpdeclare(strict_types = 1);
classFoo
{
/** * @deprecated */publicstaticfunctionbar(): void
{
}
}
classFoo2
{
#[Deprecated]
publicstaticfunctionbar(): void
{
}
}
classC
{
publicfunctiontest(): void
{
// Removing @deprecated annotation will correctly "invalidate" cache// and therefore not trigger an errorFoo::bar();
// Removing [#Deprecated] attribute will NOT "invalidate" cache // and therefore error will still be there even though it's now OK to call the methodFoo2::bar();
}
}
The text was updated successfully, but these errors were encountered:
Bug report
Changing method/property attributes does not trigger analysis of dependent files because PHP Attributes are not taken into account in
src/Dependency/ExportedNodeResolver.php
.Although questionable, attributes are part of public API in my opinion (even though accessible only via reflection), especially for tools like PHPStan where I expect migration from annotations to attributes in the near future (PHPStorm already pushes usage of
#[Deprecated]
,#[ArrayShape]
,...)Current behaviour makes it impossible to write rules that disallow calling
#[Deprecated]
methods whereas the same example with@deprecated
works properly.Let's assume we have a rule that forbids calling methods that are deprecated.
Then following will happen with current behaviour.
Code snippet that reproduces the problem
The text was updated successfully, but these errors were encountered: