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

Commit

Permalink
Fix #5959 update DiAbstractFactory canCreateServiceWithName
Browse files Browse the repository at this point in the history
  • Loading branch information
noopable authored and Ocramius committed Apr 3, 2014
1 parent 6e7183d commit 7a0a31a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions library/Zend/ServiceManager/Di/DiAbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $
*/
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
return $this->instanceManager->hasSharedInstance($requestedName)
if ($this->instanceManager->hasSharedInstance($requestedName)
|| $this->instanceManager->hasAlias($requestedName)
|| $this->instanceManager->hasConfig($requestedName)
|| $this->instanceManager->hasTypePreferences($requestedName)
|| $this->definitions->hasClass($requestedName);
) {
return true;
}

if (! $this->definitions->hasClass($requestedName) || interface_exists($requestedName)) {
return false;
}

return true;
}
}

0 comments on commit 7a0a31a

Please sign in to comment.