PHP中的Lint动态返回类型

PHP中的Lint动态返回类型,php,documentation,linter,Php,Documentation,Linter,我想能够自动完成时,使用我的以下代码。我一直在寻找解决办法,但似乎什么也找不到 这是关于我的模特的样子。在下面的示例中,我希望能够选项卡example和test class ExampleModel extends Model { public function example() { //Do Something } public function test() { //Do Something } } 检索模型的My函数: /

我想能够自动完成时,使用我的以下代码。我一直在寻找解决办法,但似乎什么也找不到

这是关于我的模特的样子。在下面的示例中,我希望能够选项卡
example
test

class ExampleModel extends Model {
    public function example() {
        //Do Something
    }
    public function test() {
        //Do Something
    }
}
检索模型的My函数:

/**
* Returns an object of the requested model
* @param string $model Name of the model
* @return Model Object of the model
*/
public function getModel($model) {
    $model .= "Model";
    $path = "models/$model.php";
    if (!isset($this->modelCache[$model])) {
        if (file_exists($path)) {
            require_once $path;
        } else {
            throw new Exception("Model: $model does not exist!");
        }                
        $this->modelCache[$model] = new $model($this);
    }
    return $this->modelCache[$model];
}
我是这样称呼一个模型的:

$x->getModel("Example")->example();

我期待着你的想法。我很高兴听到你对这个问题的想法!当然,我也愿意接受关于
getModel
函数本身的建议。

虽然我仍然想知道如何在不改变进程本身的情况下实现这一点,但我已经通过简单地使用静态类和名称空间解决了这个问题。linting就是这样很棒。

虽然我仍然想知道如何在不改变流程本身的情况下实现这一点,但我已经通过简单地使用静态类和名称空间解决了这个问题。这样的绒线很好