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

Commit a4cc947

Browse files
committed
Merge pull request #152 from webimpress/hotfix/152
ControllerLoaderFactory fix + deprecated (v2)
2 parents ad01dbf + 3b6404d commit a4cc947

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Service/ControllerLoaderFactory.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
use Zend\ServiceManager\FactoryInterface;
1414
use Zend\ServiceManager\ServiceLocatorInterface;
1515

16+
/**
17+
* @deprecated please use the {@see \Zend\Mvc\Service\ControllerManagerFactory} factory instead:
18+
* this class will be removed in release 3.0
19+
*/
1620
class ControllerLoaderFactory implements FactoryInterface
1721
{
1822
/**
@@ -33,8 +37,13 @@ class ControllerLoaderFactory implements FactoryInterface
3337
*/
3438
public function createService(ServiceLocatorInterface $serviceLocator)
3539
{
36-
$controllerLoader = new ControllerManager();
37-
$controllerLoader->setServiceLocator($serviceLocator);
40+
trigger_error(sprintf(
41+
'%s is deprecated; please use %s instead',
42+
__CLASS__,
43+
ControllerManagerFactory::class
44+
), E_USER_DEPRECATED);
45+
46+
$controllerLoader = new ControllerManager($serviceLocator);
3847
$controllerLoader->addPeeringServiceManager($serviceLocator);
3948

4049
$config = $serviceLocator->get('Config');

0 commit comments

Comments
 (0)