Skip to content

Commit

Permalink
Merge pull request #19 from antonovsky/master
Browse files Browse the repository at this point in the history
Simple support of Instance::of in configuration
  • Loading branch information
bazilio91 authored Nov 15, 2020
2 parents 2993af8 + b89741c commit 559b9b0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions StubsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use yii\console\Controller;
use yii\console\Exception;
use yii\di\Instance;

class StubsController extends Controller
{
Expand Down Expand Up @@ -88,9 +89,18 @@ public function actionIndex()
}

if (isset($component['class'])) {
$components[$name][] = $component['class'];
$class = $component['class'];
} elseif (isset($component['__class'])) {
$components[$name][] = $component['__class'];
$class = $component['class'];
}

if (isset($class)) {
if ($class instanceof Instance)
{
$components[$name][] = get_class($class->get());
} else {
$components[$name][] = $class;
}
}
}
}
Expand Down

0 comments on commit 559b9b0

Please sign in to comment.