こんにちは、私は次のコードを持っていますが、次のエラーが発生しています:それを行う方法はありますか?
Argument 1 passed to Invoice\Invoice::__construct() must be an instance of Invoice\Data, none given, called in /Template.php on line 55 and defined
    if(!empty($this->class1) && !empty($this->class2))
    {
        if(!empty($this->params))
            call_user_func_array(array(new $this->class(new $this->class1, new $this->class2), $this->method), $this->params);
        else
            call_user_func(new $this->class(new $this->class1, new $this->class2), $this->method); // line 55
    }
    else
    {
        if(!empty($this->params))
            call_user_func_array(array(new $this->class, $this->method), $this->params);
        else
            call_user_func(array(new $this->class, $this->method));  
    }
コードの新しい更新:
if(!empty($this->model) && !empty($this->view))
{
    if(!empty($this->params))
    {
        call_user_func_array(array(new $this->view(new $this->controller, new $this->model), $this->action), $this->params);
    }
    else
    {
        call_user_func(new $this->view(new $this->controller(new $this->model), new $this->model), $this->action);
    }
}
else
{
    if(!empty($this->params))
    {
        call_user_func_array(array(new $this->controller, $this->action), $this->params);
    }
    else
    {
        call_user_func(array(new $this->controller, $this->action));
    } 
}
コントローラー モデルとビューの insde で型ヒンティングを使用して、上記のコードの各 vars に適切な引数を解析し、各クラスで適切な型ヒントを定義しています。上記のコードで達成したいことは次のとおりです。
$model = new Model();
$controller = new Controller($model);
$view = new View($controller, $model);
私が持っているエラー:
call_user_func() expects parameter 1 to be a valid callback, no array or string given
更新 そのエラーが発生している正確な行を投稿するのを忘れました
call_user_func(new $this->view(new $this->controller(new $this->model), new $this->model), $this->action);