From f15add831eb299a785489255d89ccfa931570d39 Mon Sep 17 00:00:00 2001 From: dpankratov Date: Tue, 3 May 2022 12:23:10 +0600 Subject: [PATCH] refactor: use Arr::get instead of config; Refs: https://github.com/RonasIT/laravel-swagger/issues/42 --- src/Services/SwaggerService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Services/SwaggerService.php b/src/Services/SwaggerService.php index 328213a5..f06494f9 100755 --- a/src/Services/SwaggerService.php +++ b/src/Services/SwaggerService.php @@ -38,10 +38,10 @@ class SwaggerService public function __construct(Container $container) { - $this->setDriver(); - $this->config = config('auto-doc'); + $this->setDriver(); + if (config('app.env') == 'testing') { $this->container = $container; @@ -59,8 +59,8 @@ public function __construct(Container $container) protected function setDriver() { - $driver = config('auto-doc.driver'); - $className = config("auto-doc.drivers.{$driver}.class"); + $driver = $this->config['driver']; + $className = Arr::get($this->config, "drivers.{$driver}.class"); if (!class_exists($className)) { throw new SwaggerDriverClassNotFoundException($className);