Closed
Description
Hi there. First of all. Thanks so much for this, it has been so helpful in our projects.
I encountered an issue today that surprised me. If you are calling a class method that is deprecated on the interface level, phpstan does not complain. It surprised me only because my IDE shows me this, and I never thought about checking if this was detected in phpstan as well.
Here is a minimal example:
<?php
class Foo implements FooInterface
{
/**
* {@inheritdoc}
*/
public function createBar() {}
}
interface FooInterface
{
/**
* @deprecated Don't use this plz.
*/
public function createBar();
}
$var = new Foo();
$var->createBar(); // I expect this to be an error, but it's not.
/** @var \FooInterface $var */
$var = $var;
$var->createBar(); // I also expect this to be an error, and it is.
Attached also a picture of my IDE where this is clearly identified. Not that I am saying phpstan and Phpstorm should obviously have the same feature set, just for completion on this issue report :)
Here is also the phpstan.neon file:
parameters:
level: 1
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
Using phpstan/phpstan 1.2.0 and phpstan/phpstan-deprecation-rules 1.0.0
Metadata
Metadata
Assignees
Labels
No labels