fix calendar css, take 2. (#213)
[openemr.git] / interface / modules / zend_modules / library / Zend / ServiceManager / Exception / ServiceLocatorUsageException.php
blobd248047e351ce68dcd7d227e231190d3d3e0ad9d
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\ServiceManager\Exception;
12 use Exception as BaseException;
13 use Zend\ServiceManager\AbstractPluginManager;
14 use Zend\ServiceManager\ServiceLocatorInterface;
16 class ServiceLocatorUsageException extends ServiceNotFoundException
18 /**
19 * Static constructor
21 * @param AbstractPluginManager $pluginManager
22 * @param ServiceLocatorInterface $parentLocator
23 * @param string $serviceName
24 * @param BaseException $previousException
26 * @return self
28 public static function fromInvalidPluginManagerRequestedServiceName(
29 AbstractPluginManager $pluginManager,
30 ServiceLocatorInterface $parentLocator,
31 $serviceName,
32 BaseException $previousException
33 ) {
34 return new self(
35 sprintf(
36 "Service \"%s\" has been requested to plugin manager of type \"%s\", but couldn't be retrieved.\n"
37 . "A previous exception of type \"%s\" has been raised in the process.\n"
38 . "By the way, a service with the name \"%s\" has been found in the parent service locator \"%s\": "
39 . 'did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?',
40 $serviceName,
41 get_class($pluginManager),
42 get_class($previousException),
43 $serviceName,
44 get_class($parentLocator)
47 $previousException