How dynamically instantiated classes implement code hints in PHPStorm

you can get an instance of a class through dependency injection in Yii2 in this way

        $test = \Yii::$container->get("\common\service\test");
        $test->aa();

clicking aa () will not jump to the corresponding function, and typing $test- > will not list the methods under the test class

.

there is no code hint in the following way of writing, and clicking aa () will not jump

.
        $testClass = "\common\service\test";
        $test = new $testClass;
        $test->aa();
Mar.23,2021

add comments to see if the line is OK

$testClass = '\common\service\test';
/** @var \common\service\test $test */
$test = new $testClass;
$test->aa();

the solution found so far, for the first case
https://confluence.jetbrains.


Hello, how to solve the first situation? Do I need to download any plug-ins?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b357e4-40526.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b357e4-40526.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?