$ composer show | grep phpstan
phpstan/phpdoc-parser 0.4.2 PHPDoc parser with support for nullable, intersection and generic types
phpstan/phpstan 0.12.3 PHPStan - PHP Static Analysis Tool
phpstan/phpstan-doctrine 0.12.6 Doctrine extensions for PHPStan
phpstan/phpstan-mockery 0.12.1 PHPStan Mockery extension
phpstan/phpstan-phpunit 0.12.3 PHPUnit extensions and rules for PHPStan
<?php declare(strict_types = 1);
class Logger {
public function info() : void {
}
}
abstract class A {
private Logger $logger;
public function __construct(Logger $logger)
{
$this->logger = $logger;
}
public function go() : void
{
$this->parse();
}
protected function parse() : void
{
if ($this instanceof B) {
$this->logger->info();
}
}
}
class B extends A {
}
$logger = new Logger();
$b = new B($logger);