Skip to content

Commit

Permalink
refactor: use Arr::get instead of config;
Browse files Browse the repository at this point in the history
Refs: #42
  • Loading branch information
DenTray committed May 3, 2022
1 parent c9c75d1 commit f15add8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Services/SwaggerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit f15add8

Please sign in to comment.