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

Commit

Permalink
Fix zendframework/zendframework#5959 update DiAbstractFactory canCrea…
Browse files Browse the repository at this point in the history
…teServiceWithName
  • Loading branch information
noopable authored and Ocramius committed Apr 3, 2014
1 parent 009685d commit d56de0e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/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 d56de0e

Please sign in to comment.