From bf453ce94486dc1cd45b0fd1a937c3c879213bc2 Mon Sep 17 00:00:00 2001 From: Tsvetelin Tsonev Date: Sat, 21 Apr 2018 12:16:14 +0200 Subject: [PATCH] registered Nilemin\Virtualmin\Http\HttpClientInterface in the dependency injection container --- src/Virtualmin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Virtualmin.php b/src/Virtualmin.php index f5cf505..967bdd3 100644 --- a/src/Virtualmin.php +++ b/src/Virtualmin.php @@ -11,7 +11,7 @@ use Nilemin\Virtualmin\Managers\DNS\DNSManager; use Nilemin\Virtualmin\Managers\SSL\SSLManager; use Nilemin\Virtualmin\Managers\Scripts\ScriptsManager; use Nilemin\Virtualmin\Managers\Cron\CronManager; -use Nilemin\Virtualmin\Http\HttpClient; +use Nilemin\Virtualmin\Http\HttpClientInterface; use Nilet\Components\Configuration\Config; use Nilet\Components\Container\DependencyContainer; @@ -22,7 +22,7 @@ class Virtualmin { /** * Http client. - * @var HttpClient + * @var Nilemin\Virtualmin\Http\HttpClientInterface */ private $httpClient = null; @@ -41,6 +41,7 @@ class Virtualmin { $this->httpClient = new HttpClient($url, $port, $rootName, $rootPassword, "json"); $this->dc = new DependencyContainer(); $this->dc->instance(Config::class, $config); + $this->dc->instance("Nilemin\\Virtualmin\\Http\\HttpClientInterface", function() { return $this->httpClient; }); } /**