Skip to content

Commit

Permalink
refactor to class_alias,
Browse files Browse the repository at this point in the history
the original zf2 and the bc classes is the same.
add deprecated doc for ide to old zf2 classes
  • Loading branch information
carschrotter committed Aug 25, 2017
1 parent 25db351 commit a41ec21
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 36 deletions.
37 changes: 18 additions & 19 deletions src/Zend/ServiceManager/ServiceLocatorAwareInterface.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
<?php

/**
*
* Fork from Zend framework 2.5.*
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright MNHcC (Michael Hegenbarth)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\ServiceManager {
namespace Zend\ServiceManager;

use MNHcC\Zend3bcHelper;

if (class_exists(Zend3bcHelper\ServiceManager\ServiceLocatorAwareInterface::class)) {
class_alias(Zend3bcHelper\ServiceManager\ServiceLocatorAwareInterface::class, ServiceLocatorAwareInterface::class);
} else {

use MNHcC\Zend3bcHelper\Basic\Zend3bcHelperInterface;
/**
* Fork from Zend framework 2.5.* for the Zend3bcHelper
* alias for the original zend framework 2.5 ServiceLocatorAwareInterface
* {@inheritdoc}
* @deprecated since zend framework 2.7|3.*
*/
interface ServiceLocatorAwareInterface extends Zend3bcHelperInterface {
interface ServiceLocatorAwareInterface extends Zend3bcHelper\ServiceManager\ServiceLocatorAwareInterface {

}

/**
* Set service locator
*
* @param ServiceLocatorInterface $serviceLocator
*/
public function setServiceLocator(ServiceLocatorInterface $serviceLocator);
}



/**
* Get service locator
*
* @return ServiceLocatorInterface
*/
public function getServiceLocator();
}
}
4 changes: 3 additions & 1 deletion src/Zend/ServiceManager/ServiceLocatorAwareTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Fork from Zend framework 2.5.*
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
Expand All @@ -13,7 +14,8 @@
use MNHcC\Zend3bcHelper\ServiceManager\ServiceLocatorAwareTrait as MNHcCServiceLocatorAwareTrait;

/**
* Fork from Zend framework 2.5.* for the Zend3bcHelper
* Fork from zend framework 2.5.* for the Zend3bcHelper
* @deprecated since zend framework 2.7|3.*
*/
trait ServiceLocatorAwareTrait {

Expand Down
22 changes: 12 additions & 10 deletions src/Zend/ServiceManager/ServiceManagerAwareInterface.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<?php

/**
* fork from Zend framework 2.5.*
* Fork from Zend framework 2.5.*
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\ServiceManager {
namespace Zend\ServiceManager;

use MNHcC\Zend3bcHelper;

if (class_exists(Zend3bcHelper\ServiceManager\ServiceManagerAwareInterface::class)) {
class_alias(Zend3bcHelper\ServiceManager\ServiceManagerAwareInterface::class, ServiceManagerAwareInterface::class);
} else {

/**
* Fork from Zend framework 2.5.* for the Zend3bcHelper
* alias for the original zend framework 2.5 ServiceManagerAwareInterface
* {@inheritdoc}
* @deprecated since zend framework 2.7|3.*
*/
interface ServiceManagerAwareInterface extends Zend3bcHelperInterface {
interface ServiceManagerAwareInterface extends Zend3bcHelper\ServiceManager\ServiceManagerAwareInterface {

/**
* Set service manager
*
* @param ServiceManager $serviceManager
*/
public function setServiceManager(ServiceManager $serviceManager);
}

}
21 changes: 18 additions & 3 deletions src/Zend3bcHelper/ServiceManager/ServiceLocatorAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@

namespace MNHcC\Zend3bcHelper\ServiceManager {

use Zend\ServiceManager\ServiceLocatorAwareInterface as ZendServiceLocatorAwareInterface;
use MNHcC\Zend3bcHelper\Basic\Zend3bcHelperInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* Fork from Zend framework 2.5.* for the Zend3bcHelper
*/
interface ServiceLocatorAwareInterface extends Zend3bcHelperInterface {
/**
* Set service locator
*
* @param ServiceLocatorInterface $serviceLocator
*/
public function setServiceLocator(ServiceLocatorInterface $serviceLocator);

interface ServiceLocatorAwareInterface extends ZendServiceLocatorAwareInterface {

/**
* Get service locator
*
* @return ServiceLocatorInterface
*/
public function getServiceLocator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

namespace MNHcC\Zend3bcHelper\ServiceManager {

use Zend\ServiceManager\ServiceManagerAwareInterface as ZendServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;

interface ServiceManagerAwareInterface extends ZendServiceManagerAwareInterface {

/**
* Fork from Zend framework 2.5.* for the Zend3bcHelper
*/
interface ServiceManagerAwareInterface extends Zend3bcHelperInterface {

/**
* Set service manager
Expand Down

0 comments on commit a41ec21

Please sign in to comment.