From 28a9d88ce808bb15e2cee19d393502057c9b5913 Mon Sep 17 00:00:00 2001 From: Evan Coury Date: Sat, 31 Dec 2011 10:49:50 -0700 Subject: [PATCH] [Zend\Di] Remove createDistinctParameterName() method from CompilerDefinition 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. --- src/Definition/CompilerDefinition.php | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/Definition/CompilerDefinition.php b/src/Definition/CompilerDefinition.php index 04881b6a..24db5e56 100644 --- a/src/Definition/CompilerDefinition.php +++ b/src/Definition/CompilerDefinition.php @@ -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(); @@ -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;