vearutop
vearutop

Reputation: 4062

PHPDoc to describe dynamic reference to static method

    $class = 'MyClass';
    $class::method();

Is it possible to add auto-complete of ::method(); with PHPDoc?

Upvotes: 0

Views: 523

Answers (1)

LazyOne
LazyOne

Reputation: 165148

Yes. But this way only:

<?php
$class = 'MyClass';
/** @var MyClass|string $class */
$class::method();

enter image description here

Upvotes: 2

Related Questions