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

Commit

Permalink
[Zend\Di] Remove createDistinctParameterName() method from CompilerDe…
Browse files Browse the repository at this point in the history
…finition

Also removed superfluous call to createDistinctParameterName(). This is the same
change that was performed in the RuntimeDefinition. Per discussion with Ralph in
IRC, this is no longer used at all.
  • Loading branch information
EvanDotPro committed Dec 31, 2011
1 parent 2b6d3b3 commit 28a9d88
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/Definition/CompilerDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ protected function processParams(&$def, Reflection\ClassReflection $rClass, Refl
/** @var $p \ReflectionParameter */
$actualParamName = $p->getName();

$paramName = $this->createDistinctParameterName($actualParamName, $rClass->getName());

$fqName = $rClass->getName() . '::' . $rMethod->getName() . ':' . $p->getPosition();

$def['parameters'][$methodName][$fqName] = array();
Expand All @@ -214,30 +212,6 @@ protected function processParams(&$def, Reflection\ClassReflection $rClass, Refl

}

protected function createDistinctParameterName($paramName, $class)
{
$currentParams = array();
if ($this->classes[$class]['parameters'] === array()) {
return $paramName;
}
foreach ($this->classes as $cdata) {
foreach ($cdata['parameters'] as $mdata) {
$currentParams = array_merge($currentParams, array_keys($mdata));
}
}

if (!in_array($paramName, $currentParams)) {
return $paramName;
}

$alt = 2;
while (in_array($paramName . (string) $alt, $currentParams)) {
$alt++;
}

return $paramName . (string) $alt;
}

// public function processClass($className)
// {
// $strategy = $this->introspectionStrategy;
Expand Down

0 comments on commit 28a9d88

Please sign in to comment.