Open
Description
If a class is deprecated, I would expect that any calls to methods in that deprecated class should also trigger a deprecation message.
For example, a change that I implemented locally in CallToDeprecatedMethodRule
:
if ($classReflection->isDeprecated()) {
$description = $methodReflection->getDeprecatedDescription();
if ($description === null) {
return [sprintf(
'Call to method %s() of deprecated class %s.',
$methodReflection->getName(),
$methodReflection->getDeclaringClass()->getName()
)];
}
return [sprintf(
"Call to method %s() of deprecated class %s:\n%s",
$methodReflection->getName(),
$methodReflection->getDeclaringClass()->getName(),
$description
)];
}
Though maybe this makes more sense as a separate rule within this library, it works well enough for my needs.
Metadata
Metadata
Assignees
Labels
No labels