Skip to content

Commit 70ebf54

Browse files
committed
Reverse BC break for early zf2
1 parent 8dfd5f8 commit 70ebf54

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

src/SwaggerModule/Controller/DocumentationControllerFactory.php

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,22 @@
2020

2121
namespace SwaggerModule\Controller;
2222

23-
use Interop\Container\ContainerInterface;
24-
use Zend\ServiceManager\AbstractFactoryInterface;
23+
use Zend\ServiceManager\FactoryInterface;
2524
use Zend\ServiceManager\ServiceLocatorInterface;
2625

27-
class DocumentationControllerFactory implements AbstractFactoryInterface
26+
class DocumentationControllerFactory implements FactoryInterface
2827
{
29-
public function canCreate(ContainerInterface $container, $requestedName)
28+
public function createService(ServiceLocatorInterface $serviceLocator)
3029
{
31-
return class_exists($requestedName);
32-
}
30+
/** @var $realServiceLocator ServiceLocatorInterface */
31+
$realServiceLocator = $serviceLocator->getServiceLocator();
3332

34-
public function canCreateServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)
35-
{
36-
return $this->canCreate($services, $requestedName);
37-
}
38-
39-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
40-
{
4133
$controller = new DocumentationController();
42-
/** @var \Swagger\Annotations\Swagger */
43-
$swagger = $container->get('Swagger\Annotations\Swagger');
34+
35+
/** @var $swagger \Swagger\Annotations\Swagger */
36+
$swagger = $realServiceLocator->get('Swagger\Annotations\Swagger');
4437
$controller->setSwagger($swagger);
45-
return $controller;
46-
}
4738

48-
public function createServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)
49-
{
50-
return $this($services, $requestedName);
39+
return $controller;
5140
}
52-
}
41+
}

0 commit comments

Comments
 (0)