Fixed Plugin construct (options arg)

This commit is contained in:
Dmitry Khomutov 2016-07-10 10:10:34 +06:00
parent f7279b2505
commit 2548cc2b30

View file

@ -99,7 +99,11 @@ class Factory
if ($constructor) {
$argsToUse = [];
foreach ($constructor->getParameters() as $param) {
$argsToUse = $this->addArgFromParam($argsToUse, $param);
if ('options' === $param->getName()) {
$argsToUse[] = $options;
} else {
$argsToUse = $this->addArgFromParam($argsToUse, $param);
}
}
$plugin = $reflectedPlugin->newInstanceArgs($argsToUse);
} else {
@ -204,7 +208,7 @@ class Factory
{
$name = $param->getName();
$type = $this->getParamType($param);
$arg = $this->getResourceFor($type, $name);
$arg = $this->getResourceFor($type, $name);
if ($arg !== null) {
$existingArgs[] = $arg;