Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#3260] CS fixes

- Removed "_" prefix from getCallParameters()
- whitespace between operators and parens
- added braces to logic blocks
  • Loading branch information...
commit 21fd2cd08c57f510f042249da01b1e221272ccc5 1 parent c238bee
@weierophinney weierophinney authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 library/Zend/Di/Di.php
View
26 library/Zend/Di/Di.php
@@ -125,17 +125,18 @@ public function instanceManager()
* @param string $method
* @return array
*/
-
- public function _getCallParameters($name, array $params, $method = "__construct")
+ protected function getCallParameters($name, array $params, $method = "__construct")
{
- $im = $this->instanceManager;
+ $im = $this->instanceManager;
$class = $im->hasAlias($name) ? $im->getClassFromAlias($name) : $name;
- if($this->definitions->hasClass($class)) {
+ if ($this->definitions->hasClass($class)) {
$callParameters = array();
- if($this->definitions->hasMethod($class, $method)) {
- foreach($this->definitions->getMethodParameters($class, $method) as $param)
- if(isset($params[$param[0]]))
+ if ($this->definitions->hasMethod($class, $method)) {
+ foreach ($this->definitions->getMethodParameters($class, $method) as $param) {
+ if (isset($params[$param[0]])) {
$callParameters[$param[0]] = $params[$param[0]];
+ }
+ }
}
return $callParameters;
}
@@ -159,22 +160,21 @@ public function get($name, array $params = array())
$im = $this->instanceManager;
- $callParameters = $this->_getCallParameters($name, $params);
- if($callParameters) {
+ $callParameters = $this->getCallParameters($name, $params);
+ if ($callParameters) {
$fastHash = $im->hasSharedInstanceWithParameters($name, $callParameters, true);
if ($fastHash) {
array_pop($this->instanceContext);
-
return $im->getSharedInstanceWithParameters(null, array(), $fastHash);
}
} else {
if ($im->hasSharedInstance($name, $callParameters)) {
array_pop($this->instanceContext);
-
return $im->getSharedInstance($name, $callParameters);
}
}
- $config = $im->getConfig($name);
+
+ $config = $im->getConfig($name);
$instance = $this->newInstance($name, $params, $config['shared']);
array_pop($this->instanceContext);
@@ -250,7 +250,7 @@ public function newInstance($name, array $params = array(), $isShared = true)
}
if ($isShared) {
- if ($callParameters = $this->_getCallParameters($name, $params)) {
+ if ($callParameters = $this->getCallParameters($name, $params)) {
$this->instanceManager->addSharedInstanceWithParameters($instance, $name, $callParameters);
} else {
$this->instanceManager->addSharedInstance($instance, $name);
Please sign in to comment.
Something went wrong with that request. Please try again.