Skip to content

Commit

Permalink
Solves outeredge#12. Adding BC for ZF2.
Browse files Browse the repository at this point in the history
  • Loading branch information
athlan committed Jun 27, 2017
1 parent 19fc5d8 commit b8c2ee5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

'controllers' => array(
'factories' => array(
'SwaggerModule\Controller\Documentation' => 'SwaggerModule\Controller\DocumentationControllerFactory',
'SwaggerModule\Controller\Documentation' => 'SwaggerModule\Controller\DocumentationControllerZf2ShimFactory',
),
),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* SwaggerModule
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @copyright Copyright (c) 2012 OuterEdge UK Ltd (http://www.outeredgeuk.com)
* @license http://www.apache.org/licenses/LICENSE-2.0
*/

namespace SwaggerModule\Controller;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
* DocumentationController factory
*
* @deprecated ZF2 BC, see \Zend\ServiceManager\FactoryInterface
*/
class DocumentationControllerZf2ShimFactory implements FactoryInterface
{
public function createService(ServiceLocatorInterface $serviceLocator)
{
$controller = new DocumentationController();
/** @var $swagger \Swagger\Annotations\Swagger */
$swagger = $serviceLocator->get('Swagger\Annotations\Swagger');
$controller->setSwagger($swagger);
return $controller;
}
}

0 comments on commit b8c2ee5

Please sign in to comment.