Answer the question
In order to leave comments, you need to log in
How to skip parameters in Yii2 Dependency Container?
The class UnsavedPurchaseService
has the following constructor:
public function __construct(OrderRepository $orders, Reporter $reporter)
{
$this->orders = $orders;
$this->reporter = $reporter;
}
OrderRepository
is configured by the container itself, and Reporter
the interface, and you need to pass the implementation specifically under theUnsavedPurchaseService
. $container->set(UnsavedPurchaseService::class, ['', new TelegramReporter($service, $app->params['telegram.developerChat.id'])])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question