Phpstorm cannot prompt for $this- > xxxx (). Do you know how to solve this problem if you have friends who have encountered it?

the following code is abbreviated, roughly in this way, just look at the key points
again, don"t worry about the details, I can use [] to mark the key points ~

.
class xxx
{
    public function file($name = "")
    {
        $item[$name] = (new Upload($temp["tmp_name"]))->setUploadInfo($temp);
        
        retuirn $item[$name];
    }
}

$file = (new xxx)->file("xxx");
$file->xxxUpload   "->XXX" ide

so how to solve this problem? If you don"t give a hint, it will greatly reduce your work efficiency

.
Php
Aug.10,2021

Settings-> language & Framework-> PHP, select a php version in the drop-down box to try


your code. The
file method return is an array of $item, not an instance of Upload. Oh, think about it.

Menu