Skip to content

Commit

Permalink
ServiceLocator. Fix определения зависимости через type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
sokolovsky committed Nov 27, 2015
1 parent 23096f4 commit 6f88f41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/services/serviceslocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function createInstance($name, $params = array(), $depends = array()) {
$constructor = $refClass->getMethod('__construct');
foreach ($constructor->getParameters() as $cParameter) {
$cParamValue = null;
$cParameter->getDeclaringClass() && $cParamValue = $instances[$cParameter->getDeclaringClass()->getName()];
$cParameter->getClass() && $cParamValue = $instances[$cParameter->getClass()->getName()];
$values[$cParameter->getName()] && $cParamValue = $values[$cParameter->getName()];
$constructParams[] = $cParamValue;
}
Expand Down

0 comments on commit 6f88f41

Please sign in to comment.