1
0
mirror of synced 2025-02-10 17:29:27 +03:00

#6003 removed useless method parameter count checking duplication

This commit is contained in:
Marco Pivetta 2016-09-08 00:43:29 +02:00
parent 61f6b667c0
commit 6f79a378d5

View File

@ -310,22 +310,10 @@ class EntityRepository implements ObjectRepository, Selectable
$fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by)); $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by));
if ($this->_class->hasField($fieldName) || $this->_class->hasAssociation($fieldName)) { if (! ($this->_class->hasField($fieldName) || $this->_class->hasAssociation($fieldName))) {
switch ($argsCount) {
case 1:
return $this->$method(array($fieldName => $arguments[0]));
case 2:
return $this->$method(array($fieldName => $arguments[0]), $arguments[1]);
case 3:
return $this->$method(array($fieldName => $arguments[0]), $arguments[1], $arguments[2]);
case 4:
return $this->$method(array($fieldName => $arguments[0]), $arguments[1], $arguments[2], $arguments[3]);
}
}
throw ORMException::invalidMagicCall($this->_entityName, $fieldName, $method . $by); throw ORMException::invalidMagicCall($this->_entityName, $fieldName, $method . $by);
} }
return $this->$method([$fieldName => $arguments[0]], ...array_slice($arguments, 1));
}
} }