Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Removing unused method parameter $alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed May 15, 2012
1 parent c60b061 commit 068f448
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Di.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function newInstance($name, array $params = array(), $isShared = true)
}
}

$this->handleInjectDependencies($instance, $name, $injectionMethods, $supertypeInjectionMethods, $params, $alias);
$this->handleInjectDependencies($instance, $name, $injectionMethods, $supertypeInjectionMethods, $params);

array_pop($this->instanceContext);
return $instance;
Expand Down Expand Up @@ -236,11 +236,11 @@ public function injectDependencies($instance, array $params = array())
$superTypeInjectionMethods[$interface] = $definitions->getMethods($interface);
}
}
$this->handleInjectDependencies($instance, null, $injectionMethods, $superTypeInjectionMethods, $params, null);
$this->handleInjectDependencies($instance, null, $injectionMethods, $superTypeInjectionMethods, $params);
}


protected function handleInjectDependencies($instance, $name, $injectionMethods, $supertypeInjectionMethods, $params, $alias)
protected function handleInjectDependencies($instance, $name, $injectionMethods, $supertypeInjectionMethods, $params)
{
$class = get_class($instance);

Expand All @@ -251,13 +251,13 @@ protected function handleInjectDependencies($instance, $name, $injectionMethods,
if ($injectionMethods || $supertypeInjectionMethods) {
foreach ($injectionMethods as $injectionMethod => $methodIsRequired) {
if ($injectionMethod !== '__construct'){
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, $params, $alias, $methodIsRequired, $class);
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, $params, $name, $methodIsRequired, $class);
}
}
foreach ($supertypeInjectionMethods as $supertype => $supertypeInjectionMethod) {
foreach ($supertypeInjectionMethod as $injectionMethod => $methodIsRequired) {
if ($injectionMethod !== '__construct') {
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, $params, $alias, $methodIsRequired, $supertype);
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, $params, $name, $methodIsRequired, $supertype);
}
}
}
Expand Down Expand Up @@ -294,7 +294,7 @@ protected function handleInjectDependencies($instance, $name, $injectionMethods,
if ($methodParams) {
foreach ($methodParams as $methodParam) {
if (get_class($objectToInject) == $methodParam[1] || $this->isSubclassOf(get_class($objectToInject), $methodParam[1])) {
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, array($methodParam[0] => $objectToInject), $alias, true, get_class($instance));
$this->resolveAndCallInjectionMethodForInstance($instance, $injectionMethod, array($methodParam[0] => $objectToInject), $name, true, get_class($instance));
continue 3;
}
}
Expand All @@ -304,7 +304,7 @@ protected function handleInjectDependencies($instance, $name, $injectionMethods,
}
if ($methodsToCall) {
foreach ($methodsToCall as $methodInfo) {
$this->resolveAndCallInjectionMethodForInstance($instance, $methodInfo['method'], $methodInfo['args'], $alias, true, get_class($instance));
$this->resolveAndCallInjectionMethodForInstance($instance, $methodInfo['method'], $methodInfo['args'], $name, true, get_class($instance));
}
}
}
Expand Down

0 comments on commit 068f448

Please sign in to comment.