phpstan / phpstan-deprecation-rules

PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.
MIT License
378 stars 18 forks source link

Detect deprecated methods from the interface as well. Fix #48 #49

Closed eiriksm closed 2 years ago

ondrejmirtes commented 2 years ago

Hi, this ought to be rather fixed in https://github.com/phpstan/phpstan-src/blob/eb074fdc9a70542c9d227b26a89031aeeeca7943/src/PhpDoc/ResolvedPhpDocBlock.php#L193 - it should be merged from parent docblocks as well, see for example how the throwsTag is handled above.

Can be tested for example in ClassReflectionTest by getting $this->createReflectionProvider(), and getting the class method in question to see if PHPStan considers it deprecated as well.

eiriksm commented 2 years ago

Sounds even better. Created here: https://github.com/phpstan/phpstan-src/pull/792