Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

remove copy variable for no reason #3322

Closed
wants to merge 1 commit into from

2 participants

@samsonasik

No description provided.

@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3322' into develop
Forward port #3322
0db241e
@weierophinney weierophinney was assigned
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3322'
Close #3322
77dc4ba
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3322' into develop
Forward port #3322
2f12bd7
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-servicemanager
@weierophinney weierophinney Merge branch 'hotfix/3322' 754bd9a
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-servicemanager
@weierophinney weierophinney Merge branch 'hotfix/3322' into develop 485d763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 1, 2013
  1. @samsonasik
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 7 deletions.
  1. +4 −7 library/Zend/ServiceManager/ServiceManager.php
View
11 library/Zend/ServiceManager/ServiceManager.php
@@ -226,9 +226,8 @@ public function retrieveFromPeeringManagerFirst()
public function setInvokableClass($name, $invokableClass, $shared = true)
{
$cName = $this->canonicalizeName($name);
- $rName = $name;
- if ($this->has(array($cName, $rName), false)) {
+ if ($this->has(array($cName, $name), false)) {
if ($this->allowOverride === false) {
throw new Exception\InvalidServiceNameException(sprintf(
'A service by the name or alias "%s" already exists and cannot be overridden; please use an alternate name',
@@ -257,7 +256,6 @@ public function setInvokableClass($name, $invokableClass, $shared = true)
public function setFactory($name, $factory, $shared = true)
{
$cName = $this->canonicalizeName($name);
- $rName = $name;
if (!is_string($factory) && !$factory instanceof FactoryInterface && !is_callable($factory)) {
throw new Exception\InvalidArgumentException(
@@ -265,7 +263,7 @@ public function setFactory($name, $factory, $shared = true)
);
}
- if ($this->has(array($cName, $rName), false)) {
+ if ($this->has(array($cName, $name), false)) {
if ($this->allowOverride === false) {
throw new Exception\InvalidServiceNameException(sprintf(
'A service by the name or alias "%s" already exists and cannot be overridden, please use an alternate name',
@@ -411,7 +409,6 @@ public function setShared($name, $isShared)
public function get($name, $usePeeringServiceManagers = true)
{
$cName = $this->canonicalizeName($name);
- $rName = $name;
$isAlias = false;
if ($this->hasAlias($cName)) {
@@ -433,8 +430,8 @@ public function get($name, $usePeeringServiceManagers = true)
$instance = $this->retrieveFromPeeringManager($name);
}
if (!$instance) {
- if ($this->canCreate(array($cName, $rName))) {
- $instance = $this->create(array($cName, $rName));
+ if ($this->canCreate(array($cName, $name))) {
+ $instance = $this->create(array($cName, $name));
} elseif ($usePeeringServiceManagers && !$retrieveFromPeeringManagerFirst) {
$instance = $this->retrieveFromPeeringManager($name);
}
Something went wrong with that request. Please try again.